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

wordpress创建文章不显示seo自然优化排名

wordpress创建文章不显示,seo自然优化排名,个人注册网址怎么注册,网站顶部广告代码近期产品提出了一个需求,要求一个form的表单里面的一个组件既可以下拉模糊搜索,又可以弹窗搜索,我就为这个封装了一个组件,下面看效果图。 效果大家看到了,下面就看组件封装和实现方法 第一步,组件封装&…

        近期产品提出了一个需求,要求一个form的表单里面的一个组件既可以下拉模糊搜索,又可以弹窗搜索,我就为这个封装了一个组件,下面看效果图。

        00eef765102e486482f9b2a0a92043b5.gif

d9bef8291ae24f4493f29edbabea8504.png

 

效果大家看到了,下面就看组件封装和实现方法

 

第一步,组件封装,我取名为C_SerachBtn 组件,其中的C_Select组件也可以用el-select组件来代替,C_Select使我们自己封装的组件。

1fb50761e1e44a21a732c5d27c864127.png

 

<template><div class="search-box"><C_Selectv-bind="$attrs"v-model="_modelValue"filterableremoteclearablereserve-keywordremote-show-suffix:remote-method="overhaulProjectCodeMethod":options="_options || []":loading="_loading"@focus="focus"@change="handleChangeSearchBtn($event)"/><el-button:icon="Search"color="#f5f7fa"class="search-box-btn"@click="handleBtnClick"/></div>
</template><script lang="ts" setup>
import { isFunction } from '@/utils/d_is'
import { Search } from '@element-plus/icons-vue'interface Props {value: anylabel?: anyoption?: anyoptions?: any[]// query代表的值queryValue: string// 列表label代表的字段labelField?: string// 列表label代表的字段valueField?: stringdisabledField?: string// 下拉数据请求接口api?: (arg?: any) => Promise<any>// 接口参数params?: any//返回的值和赋值的值callBackNames: any[],// 返回列表数据字段resultField?: string// 是否立即请求接口,否则将在第一次获取焦点时触发请求immediate?: boolean// 是否多选multiple?: boolean
}const props = withDefaults(defineProps<Props>(), {labelField: 'label',valueField: 'value',disabledField: 'disabled',resultField: 'records',queryValue:'',callBackNames:[],immediate: true,
})
const emits = defineEmits(['update:value','update:label','update:option','change','visible-change','remove-tag','clear','blur','focus',// 下拉接口重新请求,数据更新后触发'options-change',//按钮点击'btn-click',
])
const _selectRef = ref()
const _modelValue = ref(props.value || '')
const _options = ref(props.options || [])
const _option = ref(props.option || {})
const _loading = ref(false)watch(() => props.options,(newVal) => {if (props.api) return_options.value = newVal},{deep: true,}
)watch(() => props.option,(newVal) => {_option.value = newVal},{deep: true,}
)watch(() => props.value,(newVal) => {if (props.multiple && !Array.isArray(newVal)) {console.error('multiple 为true时,传入的value数据类型必须为array')}_modelValue.value = newVal},{immediate: true,}
)watch(() => _modelValue.value,() => {emits('update:value', _modelValue.value)},{immediate: true,}
)//标准项目编号-搜索开始
const overhaulProjectCodeMethod = async (query: string) => {if (query) {const api = props.apiif (!api || !isFunction(api)) return_options.value = []_loading.value = truelet obj= {pageNum: 1,pageSize: 10,...props.params,}obj[props.queryValue] = querylet res = await api(obj)_loading.value = falselet arr = props.labelField.split(',')_options.value = res.records.map((item) => {let str =''arr.forEach(p=> str += item[p] +' ')return {label: str,value: item[props.valueField],name: item[props.valueField],key: item[props.valueField],...item,}})} else {_options.value = []}
}async function handleChangeSearchBtn(val) {if(!val){props.callBackNames.forEach(p=>{_option.value[p.value]  = ''})return}let obj = _options.value.filter((el) => el.value == val)[0]props.callBackNames.forEach(p=>{_option.value[p.value]  = obj[p.name]})change(val)
}//按钮点击
const handleBtnClick = () => {emits('btn-click', unref(_options))
}// 下拉接口重新请求,数据更新后触发
const emitChange = () => {emits('options-change', unref(_options))
}
// 当 input 获得焦点时触发
const focus = (e) => {emits('focus', e)
}
// 选中值发生变化时触发
const change = (val) => {let data = _options.value?.filter((x) => x.value == val)emits('change', val, data)
}
// 下拉框出现/隐藏时触发
const visibleChange = (val: boolean) => {handleFetch()emits('visible-change', val)
}
// 多选模式下移除tag时触发
const removeTag = (val) => {emits('remove-tag', val)
}
// 可清空的单选模式下用户点击清空按钮时触发
const clear = (e) => {emits('clear', e)
}
// 当 input 失去焦点时触发
const blur = (e) => {emits('blur', e)
}
const getOptions = () => _options.value
defineExpose({ selectMethods: _selectRef, getOptions })
</script><style scoped>
.search-box{display: flex;width: 100%;.search-box-btn{border-top-left-radius: 0px;border-bottom-left-radius: 0px;border-top: 1px solid #dcdfe6;border-right: 1px solid #dcdfe6;border-bottom: 1px solid #dcdfe6;color: #a8abb2;}
}
</style>

第二步,页面使用,在页面中el-table中当做slot使用,我的slot取名为 overhaulProjectCode

  <!-- 标准项目编号 --><template #overhaulProjectCode="{ row, index }"><C_SearchBtnv-model:value="row.overhaulProjectCode":placeholder="'请选择'":api="ListOverhaulProject":option="row":queryValue="'overhaulCode'":params="{deviceCode: 0,status: 3,}":labelField="'overhaulCode,overhaulName'":valueField="'overhaulCode'":options="[]":callBackNames="[{name: 'id',value: 'overhaulProjectId',},{name: 'overhaulCode',value: 'overhaulProjectCode',},{name: 'overhaulName',value: 'overhaulProjectName',},]"@btn-click="handleOverhaulCodeModalVisible(row, index)"@focus="handleFocus(index)"/></template>

第三步,弹窗,和一般的弹窗一样,自行封装。

<!-- 生产设备 --><materialOnetitle="选择生产设备"v-if="materialOneModalVisible":data="curRow"v-model:visible="materialOneModalVisible"@select="handleMaterialOneSelect2"@close="materialOneModalVisible = false"/>

以上就是基本的做的c_SerachBtn的组件的封装,其中的一些例如handleOverhaulCodeModalVisibl  和 handleFocus   方法需要自己定义,根据自己的具体的需求进行修改。

 

http://www.shuangfujiaoyu.com/news/58531.html

相关文章:

  • 成都疫情风险等级重庆seo整站优化系统
  • 网站建设费的摊销友情链接有哪些
  • 中国东盟建设集团有限公司网站电子商务推广方式
  • 免费商城网站模板下载天津百度
  • 眉山做网站余姚网站制作公司
  • 深圳企业登记注册抚顺seo
  • 焦作网站建设哪家正规哈尔滨seo优化软件
  • 南昌企业做网站公关公司排行榜
  • html个人网页完整代码模板seo营销培训
  • 广东网站设计费用制作一个网页的步骤
  • 微网站中定位功能怎么做的seo综合查询是什么意思
  • 网站全屏轮播怎么做百度互联网营销顾问
  • 专业做网站电话百度搜索引擎怎么做
  • 如何做输入密码进入网站网络服务器地址怎么查
  • 深圳深圳龙岗网站建设公司seo关键词优化怎么收费
  • 北海哪家做网站网站seo运营
  • 有域名有服务器如何做网站怎么免费创建网站
  • 连锁酒店网站方案百度网站下载安装
  • 小型旅游网站建设方案营销软文推广平台
  • 低价网站建设哪家更好流量平台排名
  • 哪里有网站制作平台说说seo论坛
  • 渭南市网站建设友链交易网
  • 霸州有做滤芯网站的吗营销宝
  • 0基础怎么做网站模版成都网站关键词推广优化
  • 从搜索引擎访问网站策划推广方案
  • 五指山网站开发价格seo策略
  • 乐清做网站的公司企业官方网站推广
  • wordpress福利网站源码海口百度seo公司
  • 网页生成链接淘宝优化
  • 网站建设地位成都网站优化平台