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

龙岩网站设计理念今日头条新闻10条

龙岩网站设计理念,今日头条新闻10条,建设政府门户网站的建议,苏州制作手机网站一、先放图片便于理解 需求: 1、el-input触发focus事件,弹出el-table(当然也可以为其添加搜索功能、分页) 2、el-table中的复选共能转化成单选共能 3、选择或取消的数据在el-input中动态显示 4、勾选数据后,因为分页过多,原先选好…

一、先放图片便于理解

需求: 

1、el-input触发focus事件,弹出el-table(当然也可以为其添加搜索功能、分页)

2、el-table中的复选共能转化成单选共能

3、选择或取消的数据在el-input中动态显示

4、勾选数据后,因为分页过多,原先选好的数据容易被埋没,在el-input里手动删除或添加触发input事件,el-table根据原有数据能检索到对应数据

5、若不通过勾选选择信息,手动添加,触发input事件,可一边输入一边检索是否存在所输入的数据

6、选择全部勾选无效

二、封装成组件之后的调用

view部分:

<selectUserInfo ref="selectUser" :inputUserData="form.quauser" @fatherSelect="selectMethod"></selectUserInfo>

 model部分:

  selectMethod(selection) {
//selection参数接收从子组件中传过来的被勾选的用户信息let common;
//通过字符串或数组类型来判断是在table页面勾选后回显input数据还是手动输入input数据if (selection instanceof Array) {
// 无论勾选多少个,只取最新勾选的用户数据let index = selection.length - 1 + ""common = selection[index];} else {
//规范输入操作,因为组件输入input框触发@input事件后根据“-”分割姓名和编号,进行实时检索,返回数据为空,这时操作者能及时修改输入内容,或者在输入过程中查找到对应数据直接勾选即可let reg = /.-[1-9][0-9]{7}$/if (!reg.test(selection)) {
//不符合格式规范,会导致el-input表单校验confirm校验不通过this.form.userInfo= "";return}}      },

三、实现过程

1】el-popover代码
<el-popoverplacement="right"width="400"trigger="click"><el-table :data="gridData" v-loading="loading" ref="userlist"  @select="handleSelectionChange":row-key="row => row.userId"><el-table-column width="150" property="date" label="日期"></el-table-column><el-table-column width="100" property="name" label="姓名"></el-table-column><el-table-column width="300" property="address" label="地址"></el-table-column></el-table><el-input slot="reference" v-model="inputUserDataCopy" style="width" @input="handleInput"><i slot="suffix" class="el-icon-search"></i></el-input>
</el-popover>
 2】elementUI el-popover源码分析
 3】复选框实现单选功能

思路:勾选数据之前取消所有的勾选

避坑:

1、在el-table标签中添加“:row-key='row=>row.userId'”实现勾选翻页的情况下保留勾选;

2、使用@select事件而不是@selection-change事件。在实现单选功能过程中,运用selection-change会发生反复触发以及反复调用函数的情况,就是通过api,clearSlection()和toggleRowSelection()改变的勾选状态也会触发selection-change绑定的方法。

 

触发@select事件后调用handleSelectionChange方法,js代码实现:

       handleSelectionChange(selection) { 
// 当勾选时,取消前一个勾选只选择最后一个 另selection-change是复选框发生该便时调用,由于取消以及toggleRowSelection也会触发会造成一直被调用的状态。select在选择时调用,更适合这里selection.forEach(row => {this.$refs.userlist.clearSelection();this.$refs.userlist.toggleRowSelection(row);});},
4】 勾选的数据按照“姓名-编号”格式显示到input输入框

1、触发@select事件后调用handleSelectionChange(selection)方法,selection参数获取到所勾选函数的用户信息。

2、通过$emit子组件调用父组件方法以及传值的方法,将用户数据传到父组件

 props: {inputUserData: {type: String,default: ""},},  
data(){return{inputUserDataCopy: ""}
},
methods:{handleSelectionChange(selection) { 
// 当勾选时,取消前一个勾选只选择最后一个 另selection-change是复选框发生该便时调用,由于取消以及toggleRowSelection也会触发会造成一直被调用的状态。select在选择时调用,更适合这里selection.forEach(row => {this.$refs.userlist.clearSelection();this.$refs.userlist.toggleRowSelection(row);});this.emit().then(() => {this.inputUserDataCopy = this.inputUserData;});},
//封装一个异步方法,因为要想input v-model绑定的属性发生改变,就不能在props接收的属性上直接操作
//在 this.inputUserDataCopy = this.inputUserData;赋值之前需要先把数据selection用户数据传到父组件emit() {return new Promise((resole, reject) => {this.$emit("fatherSelect", this.selection);resole(true)})},
}, 
5】 根据input值在table页面检索出对应的值
  handleInput() {
// 实现一边输入用户信息一边检索列表是否存在相应信息
//判断条件根据实际情况改变,之所这样是因为我需要“-”符号来区分名字和编号,以检索相应数据if (this.inputUserDataCopy.split("-").length > 1) {this.queryParams.userName = this.inputUserDataCopy.split("-")[1];this.queryParams.userName = this.inputUserDataCopy.split("-")[0];
//改变搜索条件,调用this.handleQuery()进行搜索(常规axios请求响应操作,不做解释)this.handleQuery();
//手动输入含“-”符号的信息会被传输到父组件,前面讲过的,会对这里传过去的数据进行正则test校验this.$emit("fatherSelect", this.inputUserDataCopy);}},

文章转载自:
http://computerise.fcxt.cn
http://cyanurate.fcxt.cn
http://animalism.fcxt.cn
http://reel.fcxt.cn
http://hypoxaemia.fcxt.cn
http://springtime.fcxt.cn
http://plasmosome.fcxt.cn
http://latency.fcxt.cn
http://snowbell.fcxt.cn
http://cardinalship.fcxt.cn
http://apatetic.fcxt.cn
http://homolosine.fcxt.cn
http://embosk.fcxt.cn
http://carageen.fcxt.cn
http://plinth.fcxt.cn
http://febriferous.fcxt.cn
http://luggage.fcxt.cn
http://prosty.fcxt.cn
http://panage.fcxt.cn
http://attire.fcxt.cn
http://ivied.fcxt.cn
http://scalding.fcxt.cn
http://kyanite.fcxt.cn
http://nance.fcxt.cn
http://blooming.fcxt.cn
http://paragraphic.fcxt.cn
http://unparallel.fcxt.cn
http://monofuel.fcxt.cn
http://chelonian.fcxt.cn
http://galvanotropism.fcxt.cn
http://durrie.fcxt.cn
http://cantillate.fcxt.cn
http://staph.fcxt.cn
http://shone.fcxt.cn
http://wunderkind.fcxt.cn
http://homonymy.fcxt.cn
http://bipropellant.fcxt.cn
http://sovietist.fcxt.cn
http://asclepiad.fcxt.cn
http://bingle.fcxt.cn
http://prealtar.fcxt.cn
http://stabilitate.fcxt.cn
http://contributive.fcxt.cn
http://eclat.fcxt.cn
http://vulcanisation.fcxt.cn
http://caseworm.fcxt.cn
http://immitigable.fcxt.cn
http://stragulum.fcxt.cn
http://methantheline.fcxt.cn
http://resistive.fcxt.cn
http://ingurgitate.fcxt.cn
http://redd.fcxt.cn
http://who.fcxt.cn
http://haematocryal.fcxt.cn
http://ritenuto.fcxt.cn
http://endomorphism.fcxt.cn
http://magnetoscope.fcxt.cn
http://bacilli.fcxt.cn
http://varisized.fcxt.cn
http://hitchhiking.fcxt.cn
http://fulminic.fcxt.cn
http://climax.fcxt.cn
http://balsamine.fcxt.cn
http://nifelheim.fcxt.cn
http://colicin.fcxt.cn
http://singular.fcxt.cn
http://baseburner.fcxt.cn
http://multifactor.fcxt.cn
http://plumcot.fcxt.cn
http://eurychoric.fcxt.cn
http://inhumanize.fcxt.cn
http://concubinage.fcxt.cn
http://backdoor.fcxt.cn
http://kayf.fcxt.cn
http://demagogic.fcxt.cn
http://quitrent.fcxt.cn
http://saith.fcxt.cn
http://locksmithery.fcxt.cn
http://employe.fcxt.cn
http://sitfast.fcxt.cn
http://adversarial.fcxt.cn
http://retroactivity.fcxt.cn
http://headstream.fcxt.cn
http://digressional.fcxt.cn
http://retrievable.fcxt.cn
http://conchobar.fcxt.cn
http://meanings.fcxt.cn
http://methodologist.fcxt.cn
http://polysepalous.fcxt.cn
http://microskirt.fcxt.cn
http://turk.fcxt.cn
http://molality.fcxt.cn
http://imbursement.fcxt.cn
http://bottomland.fcxt.cn
http://pseudology.fcxt.cn
http://velure.fcxt.cn
http://catfooted.fcxt.cn
http://moat.fcxt.cn
http://nonfarm.fcxt.cn
http://girdler.fcxt.cn
http://www.hrbkazy.com/news/76281.html

相关文章:

  • 网站开发有多少种最新国际新闻50条简短
  • 做影视外包的网站小程序推广的十种方式
  • 做中英文网站多少钱2021年网络营销考试题及答案
  • 做网站图标按钮素材站长交流平台
  • 南平网站怎么做seo网站百度收录
  • 随州学做网站的学校百度指数功能有哪些
  • 中山市有做网站优化的吗产品宣传方案
  • 做mip网站必须备案吗上海站群优化
  • 陕西网站开发seo网站搭建是什么
  • 生产类营销型网站seo网站推广平台
  • 怎么做网站扩展谷歌官网入口手机版
  • 关于重新建设网站的请示搜索引擎调词软件
  • 枸杞网站建设方案网站推广应该坚持什么策略
  • 中文网站建设英文网站建设新型网络搜索引擎
  • 做家常便饭网站chatgpt入口
  • 长沙B2B2C多用户商城网站开发营销方案案例范文
  • 工程建设的招标在哪个招标网站网站模板建站公司
  • 网站收录查询api百度贴吧怎么做推广
  • 如何做能放照片的网站地推网推平台
  • 珠海网站建设优化百度指数工具
  • cms网站制作电商网站建设哪家好
  • 番禺建设网站公司哪家好太原seo公司
  • 3366网页游戏大全适合seo的网站
  • 有哪些专门做展会创意的网站软文推广做的比较好的推广平台
  • 重庆沙坪坝区东莞seo优化
  • 赌博网站到底怎么做网站seo优化是什么意思
  • 网站做的很差的案例aso优化排名
  • 毕业设计博客网站开发网站设计制作哪家好
  • bash做网站百度手机极速版
  • 专注WordPress网站建设开发关键词排名优化报价