当前位置: 首页 > news >正文

网站资源建设网站优化工作室

网站资源建设,网站优化工作室,做的好的网站欣赏,怎么建立图片的网站基于Element UI的el-select组件进行封装的。该组件实现了一个下拉选择框#xff0c;具有许多可配置的属性和事件 创建组件index.vue (src/common-ui/select/index.vue) templateel-selectrefselectv-modelhValue:allow-createallo… 基于Element UI的el-select组件进行封装的。该组件实现了一个下拉选择框具有许多可配置的属性和事件 创建组件index.vue (src/common-ui/select/index.vue) templateel-selectrefselectv-modelhValue:allow-createallowCreate:autocompleteautocomplete:automatic-dropdownautomaticDropdown:clearableclearable:collapse-tagscollapseTags:default-first-optiondefaultFirstOption:disableddisabled:filter-methodfilterMethod:filterablefilterable:loadingloading:loading-textloadingText:multiplemultiple:multiple-limitmultipleLimit:namename:no-match-textnoMatchText:no-data-textnoDataText:placeholderplaceholder:popper-classpopperClass:popper-append-to-bodypopperAppendToBody:remoteremote:remote-methodremoteMethod:reserve-keywordreserveKeyword:sizesize:keypoperKeyValue:value-keyvalueKeyblurhandleBlurchangehandleChangeclearhandleClearfocushandleFocusremove-taghandleRemoveTagvisible-changehandleVisibleChangeslot nameprefix slotprefix/slotslot nameoption-contenttemplate v-for(item, index) in dataSourceel-option-groupv-ifitem[hProps.options] item[hProps.options].length 0 !selectSpecial:keyindex:labelitem[hProps.label]:disableditem[hProps.disabled]el-optionv-for(option, subIndex) in item[hProps.options]:keysubIndex:labeloption[hProps.label]:valueoption[hProps.value]:disabledoption[hProps.disabled]/el-option/el-option-groupel-optionv-else-if!item[hProps.options] !selectSpecial:keyindex si:labelitem[hProps.label]:valueitem[hProps.value]:disableditem[hProps.disabled]/el-optionel-optionv-else-if!item[hProps.options] selectSpecial:keyindex sp:label${item[hProps.label]}(${item[selectSpecial]}):valueitem[hProps.value]:disableditem[hProps.disabled]/el-option/template/slot/el-select /templatescript export default {name: HSelect,props: {allowCreate: {type: Boolean,default: false},selectSpecial: {type: String,default: },autocomplete: String,automaticDropdown: {type: Boolean,default: false},clearable: {type: Boolean,default: true},collapseTags: {type: Boolean,default: false},dataSource: Array,defaultFirstOption: {type: Boolean,default: false},disabled: {type: Boolean,default: false},filterMethod: Function,filterable: {type: Boolean,default: true},loading: {type: Boolean,default: false},loadingText: String,multiple: {type: Boolean,default: false},multipleLimit: Number,name: String,noMatchText: String,noDataText: String,placeholder: String,popperClass: {type: String,default: select-default},popperAppendToBody: {type: Boolean,default: true},remote: {type: Boolean,default: false},remoteMethod: Function,reserveKeyword: {type: Boolean,default: false},size: {type: String,validator (value) {return [medium, small, mini].indexOf(value) ! -1}},value: {type: [String, Number, Array, Boolean],required: true},valueKey: String,props: {type: Object,default () {return {}}},keyValue: {type: String,default: select-single},align:{type: String,default: center}},data () {return {poperKeyValue: }},computed: {hValue: {get () {let value nullif (this.multiple) {value []if (this.value instanceof Array) {this.value.forEach(key {if (this.checkValueExisting(key)) {value.push(key)}})}} else {value if (this.checkValueExisting(this.value)) {value this.value}}return value},set (value) {this.$emit(input, value)}},hProps () {return {label: name,value: id,disabled: disabled,options: options,...this.props}}},watch: {keyValue (val) {this.poperKeyValue val}},methods: {checkValueExisting (value) {if (this.allowCreate) {return value} else {if (this.dataSource instanceof Array) {let index this.dataSource.findIndex(item item[this.hProps.value] value,this)return index -1}return false}},handleBlur (event) {this.$emit(blur, event)},handleChange (value) {this.$emit(change, value)},handleClear () {this.$emit(clear)},handleFocus (event) {this.$emit(focus, event)},handleRemoveTag (tag) {this.$emit(remove-tag, tag)},handleVisibleChange (visible) {this.$emit(visible-change, visible)},focus () {this.$refs.select.focus()},blur () {this.$refs.select.blur()}} } /scriptstyle langscss scoped/style 页面引入 在需要使用HSelect组件的地方通过import语句引入HSelect组件注册并使用 templatedivh-select :data-sourcedataSource v-modelselectedValue/h-select/div /template script import HSelect from /common-ui/select/indexexport default {components: {HSelect},data() {return {dataSource:[],selectedValue: }}// ...} /script确保你已经安装了Vue.js和Element UI并在项目中引入它们。
http://www.zqtcl.cn/news/828478/

相关文章:

  • 网站规则山东网站备案网站
  • 成都网站制作龙兵科技做网站原型图用什么软件
  • 鄂州网站网站建设做网站 用哪种
  • 医药公司网站建设厦门网站建设合同
  • 网站开发全程设计注册公司哪个网站
  • 广州大型网站设计公司网站总体设计怎么写
  • 福州网站制作工具搜索引擎营销的特点是什么
  • 安徽省建设干部网站新品网络推广
  • 做网站要实名吗怎样给一个公司做网站
  • 品牌官方网站建设大航母网站建设
  • 自己做音乐网站挣钱吗网站定制公司kinglink
  • 网站建设案例新闻随州程力网站建设
  • 国外网站平台龙岩天宫山缆车收费
  • 站长工具seo综合查询是什么湖北做网站
  • 青海网站建设价格建一个免费网站的流程
  • 网站备案中 解析地址asp.net企业网站框架
  • flash里鼠标可以跟随到网站上就不能跟随了蚌埠网站建设
  • 东莞茶山网站建设网络推广方案ppt
  • 不需要写代码的网站开发软件模板之家如何免费下载
  • 购物网站模板多媒体网站开发实验报告
  • 做网站上数字快速增加上海市建设部注册中心网站
  • 义乌市网站制作青岛建设银行银行招聘网站
  • 公司网站的留言板怎么做wordpress减肥网站采集规则
  • app软件下载站seo教程wordpress实现专题
  • 在哪里自己建设网站做网站后期需要什么费用
  • 宁波网站推广怎么做微信公众号如何运营与推广
  • 做网站开发语言农产品品牌建设
  • 百度一下你就知道官方网站做准考证的网站
  • 2008 访问网站提示建设中免费asp地方门户网站系统
  • 手机网站收录wordpress无法连接ftf服务器