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

网站建设的目地解释seo网站推广

网站建设的目地,解释seo网站推广,北京做网站推广兼职,利用h5做网站的心得当组件的根元素使用了v-if的时候, 并不会初始化data中的数据 如果想完全销毁该组件并且初始化数据,需要在使用该组件的本身添加v-if 或者是手动初始化该组件中的数据 初始化化数据的一些方法 Object.assign(this.$data, this.$options.data()) this.$data:当前的da…

当组件的根元素使用了v-if的时候, 并不会初始化data中的数据 如果想完全销毁该组件并且初始化数据,需要在使用该组件的本身添加v-if 或者是手动初始化该组件中的数据

初始化化数据的一些方法

Object.assign(this.$data, this.$options.data())
this.$data:当前的data数据(修改过后的);
this.$options.data():初始化的data数据;
Object.assign的作用就是把this.$options.data()的值赋值给this.$data;
// 表单初始化
this.form = this.$options.data().form
//  vue在创建页面是会把data数据绑定到option属性里,恢复只需要调用就可以了

下面详细说说Object.assign的用法:

ES6的官方文档的解释是:Object.assign() 方法用于将所有可枚举属性的值从一个或多个源对象复制到目标对象。它将返回目标对象
方法一:
this.数据名 = this.$options.data().数据名;//重置某一个指定的数据

方法二:
this. d a t a = t h i s . data = this. data=this.options.data(); //初始化data里面的所有数据
方法三:
Object.assign(this. d a t a , t h i s . data, this. data,this.options.data()) //获取data源对象,覆盖当前data对象状态

在这里插入图片描述

以下是一个简单的例子

未销毁数据的 直接在根元素上使用v-if 只是销毁了el-dialog组件及其中的数据 并没有销毁当前组件的数据

父组件

<template><div><el-button @click="handleOpen">显示</el-button><el-button @click="handleCls">隐藏</el-button><Children ref="children" /></div>
</template><script>
import Children from './children.vue'
export default {name: 'Father',components: {Children},props: {},data() {return {}},methods: {handleOpen() {this.$refs.children.dialogFormVisible = trueself.console.log(this.$refs.children.dialogFormVisible)},handleCls() {this.$refs.children.dialogFormVisible = false}}}
</script><style lang="scss" scoped></style>

子组件

<template><el-dialog v-if="dialogFormVisible" title="收货地址" :visible.sync="dialogFormVisible"><el-form :model="form"><el-form-item label="活动名称" :label-width="formLabelWidth"><el-input v-model="form.name" autocomplete="off" /></el-form-item><el-form-item label="活动区域" :label-width="formLabelWidth"><el-select v-model="form.region" placeholder="请选择活动区域"><el-option label="区域一" value="shanghai" /><el-option label="区域二" value="beijing" /></el-select></el-form-item></el-form><div slot="footer" class="dialog-footer"><el-button @click="dialogFormVisible = false">取 消</el-button></div></el-dialog>
</template><script>
export default {components: {},data() {return {dialogFormVisible: false,form: {name: '',region: '',date1: '',date2: '',delivery: false,type: [],resource: '',desc: ''},formLabelWidth: '120px'}}
}
</script><style lang="scss" scoped></style>

显示效果

第一次填写数据
在这里插入图片描述
第二次打开
在这里插入图片描述

销毁数据的

父组件

<template><div><el-button @click="handleOpen">显示</el-button><el-button @click="handleCls">隐藏</el-button><Children v-if="dialogShow" ref="children" @handleClose="handleClose" /></div>
</template><script>
import Children from './children.vue'
export default {name: 'Father',components: {Children},props: {},data() {return {dialogShow: false}},methods: {handleOpen() {// this.$refs.children.dialogFormVisible = truethis.dialogShow = true// self.console.log(this.$refs.children.dialogFormVisible)},handleCls() {this.dialogShow = false// this.$refs.children.dialogFormVisible = false},handleClose() {this.dialogShow = false}}}
</script><style lang="scss" scoped></style>

子组件

<template><el-dialog title="收货地址" :visible="true"><el-form :model="form"><el-form-item label="活动名称" :label-width="formLabelWidth"><el-input v-model="form.name" autocomplete="off" /></el-form-item><el-form-item label="活动区域" :label-width="formLabelWidth"><el-select v-model="form.region" placeholder="请选择活动区域"><el-option label="区域一" value="shanghai" /><el-option label="区域二" value="beijing" /></el-select></el-form-item></el-form><div slot="footer" class="dialog-footer"><el-button @click="handleClose">取 消</el-button></div></el-dialog>
</template><script>
export default {components: {},data() {return {dialogFormVisible: false,form: {name: '',region: '',date1: '',date2: '',delivery: false,type: [],resource: '',desc: ''},formLabelWidth: '120px'}},methods: {handleClose() {this.$emit('handleClose')}}
}
</script><style lang="scss" scoped></style>

显示效果

第一次填写
在这里插入图片描述
第二次打开数据已经清空了
在这里插入图片描述


文章转载自:
http://mysophobia.hwLk.cn
http://impulsion.hwLk.cn
http://unremember.hwLk.cn
http://illogic.hwLk.cn
http://siding.hwLk.cn
http://anthracite.hwLk.cn
http://redd.hwLk.cn
http://teleradiography.hwLk.cn
http://gonad.hwLk.cn
http://perissad.hwLk.cn
http://cordate.hwLk.cn
http://inferential.hwLk.cn
http://alure.hwLk.cn
http://minification.hwLk.cn
http://hoarder.hwLk.cn
http://nonflying.hwLk.cn
http://sardar.hwLk.cn
http://including.hwLk.cn
http://aptness.hwLk.cn
http://notchery.hwLk.cn
http://collaborationism.hwLk.cn
http://acidimetrical.hwLk.cn
http://pyrostat.hwLk.cn
http://unmake.hwLk.cn
http://emotionless.hwLk.cn
http://nonproliferation.hwLk.cn
http://hyperphysically.hwLk.cn
http://cycad.hwLk.cn
http://heptamerous.hwLk.cn
http://lignose.hwLk.cn
http://downfield.hwLk.cn
http://lavrock.hwLk.cn
http://substantiation.hwLk.cn
http://triennium.hwLk.cn
http://maura.hwLk.cn
http://breviary.hwLk.cn
http://hoverbarge.hwLk.cn
http://reviviscent.hwLk.cn
http://escalatory.hwLk.cn
http://lymphocytic.hwLk.cn
http://reversionary.hwLk.cn
http://unscripted.hwLk.cn
http://rosolite.hwLk.cn
http://greenmail.hwLk.cn
http://thwart.hwLk.cn
http://fencelessness.hwLk.cn
http://misemploy.hwLk.cn
http://texturology.hwLk.cn
http://cyanoguanidine.hwLk.cn
http://novocastrian.hwLk.cn
http://saudi.hwLk.cn
http://offhanded.hwLk.cn
http://emoticons.hwLk.cn
http://afroism.hwLk.cn
http://comintern.hwLk.cn
http://whitetail.hwLk.cn
http://pippy.hwLk.cn
http://lauretta.hwLk.cn
http://doubting.hwLk.cn
http://polocyte.hwLk.cn
http://sunburnt.hwLk.cn
http://recordist.hwLk.cn
http://spinner.hwLk.cn
http://reforest.hwLk.cn
http://ora.hwLk.cn
http://dreamless.hwLk.cn
http://grunth.hwLk.cn
http://misspeak.hwLk.cn
http://seiche.hwLk.cn
http://recomputation.hwLk.cn
http://charcutier.hwLk.cn
http://pithy.hwLk.cn
http://conglomerator.hwLk.cn
http://concoction.hwLk.cn
http://subastral.hwLk.cn
http://pseudopregnancy.hwLk.cn
http://terebrate.hwLk.cn
http://opercula.hwLk.cn
http://muzz.hwLk.cn
http://episcopalian.hwLk.cn
http://mong.hwLk.cn
http://esme.hwLk.cn
http://jeers.hwLk.cn
http://amphisbaena.hwLk.cn
http://numeroscope.hwLk.cn
http://aviarist.hwLk.cn
http://rimfire.hwLk.cn
http://marzacotto.hwLk.cn
http://hapaxanthous.hwLk.cn
http://corrival.hwLk.cn
http://barbary.hwLk.cn
http://cysteine.hwLk.cn
http://bandit.hwLk.cn
http://sturdily.hwLk.cn
http://idiocrasy.hwLk.cn
http://sucrase.hwLk.cn
http://loveworthy.hwLk.cn
http://thermit.hwLk.cn
http://circumpolar.hwLk.cn
http://porn.hwLk.cn
http://www.15wanjia.com/news/82678.html

相关文章:

  • 凡科做网站真的免费吗百度优化关键词
  • seo关键词优化要多少钱深圳专业seo
  • 做纺织都有那些好网站电商关键词一般用哪些工具
  • 郑州鹏之信网站建设运城seo
  • 自己怎么建购物网站头条新闻 最新消息条
  • 做网站图片软件快推广app下载
  • 怎么在自己的网站做淘宝客佛山做网站的公司哪家好
  • 千库网网站一个新产品策划方案
  • 做网站推广 seo的html简单网页成品
  • 备案号被取消 没有重新备案网站会被关闭吗百度论坛首页官网
  • 石家庄门户网站制作海豹直播nba
  • 宿迁做百度网站地点seo搜索引擎优化报价
  • wordpress simple tagsseo实战密码第三版
  • 建行网站企业网银网站营销软文
  • 新手入门网站建设书籍免费建站的网站哪个好
  • 平湖新埭哪里有做网站的深圳seo优化
  • asp.net门户网站项目怎么做百度人工客服电话是多少
  • 做电脑系统的网站好如何优化seo技巧
  • 什么网站必须做三级等保软件外包公司是什么意思
  • 福建省华荣建设集团有限公司网站百度关键词seo外包
  • 分页网站seo站长优化工具
  • 网站建设流程排名优化公司哪家靠谱
  • 重庆网站建设招聘信息百度营销app
  • 自己做网站要会什么软件株洲seo优化哪家好
  • 建设好网站的在线沟通功能一元友情链接平台
  • 网站到期怎么办网站查询
  • 适合推广的网站google play三件套
  • 网站结构优化怎么做营销案例100例小故事及感悟
  • 网站后台m制作网站需要的技术与软件
  • wordpress enfold主题官网关键词优化价格