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

如何用wordpress做网站营销推广方案范文

如何用wordpress做网站,营销推广方案范文,石家庄定制网站建设多少钱,合肥建设发展局网站目录 一、概述 二、获取dom 2.1. 具体步骤 2.2. 完整代码 2.2.1. main.js 2.2.2. App.vue 2.3. BaseChart.vue 三、获取组件实例 3.1. 具体步骤 3.2. 完整代码 3.2.1. main.js 3.2.2. App.vue 3.2.3. BaseForm.vue 3.3. 运行效果 一、概述 我们过去在想要获取一…

目录

一、概述 

二、获取dom

2.1. 具体步骤

2.2. 完整代码 

2.2.1. main.js

2.2.2. App.vue

2.3. BaseChart.vue

三、获取组件实例

3.1. 具体步骤

3.2. 完整代码

3.2.1. main.js

3.2.2. App.vue

3.2.3. BaseForm.vue

3.3. 运行效果


一、概述 

我们过去在想要获取一个dom元素的时候,一般会使用到document.querySelector('class样式')这种全页面范围的查找方式。如果在页面比较复杂(如有多个组件且可能存在相同样式)的情况下,通过这种方式就获取就难以定位一个dom元素。因此Vue为我们提供了ref和$refs。

 

querySelector 查找范围 → 整个页面 

作用:利用ref和$refs可以用于获取dom元素组件实例。

特点:查找范围 → 当前组件内 (更精确稳定)

二、获取dom

2.1. 具体步骤

1. 目标标签 – 添加 ref 属性

2. 恰当时机, 通过 this.$refs.xxx, 在当前组件内查找获取目标标签

2.2. 完整代码 

2.2.1. main.js

import Vue from 'vue'
import App from './App.vue'Vue.config.productionTip = falsenew Vue({render: h => h(App),
}).$mount('#app')

2.2.2. App.vue

<template><div class="app"><div class="base-chart-box">这是一个捣乱的盒子</div><BaseChart></BaseChart></div>
</template><script>
import BaseChart from './components/BaseChart.vue'
export default {components:{BaseChart}
}
</script><style>
.base-chart-box {width: 300px;height: 200px;
}
</style>

2.3. BaseChart.vue

<template><div class="base-chart-box" ref="baseChartBox">子组件</div>
</template><script>
import * as echarts from 'echarts'export default {mounted() {// 基于准备好的dom,初始化echarts实例// document.querySelector 会查找项目中所有的元素// $refs只会在当前组件查找盒子// var myChart = echarts.init(document.querySelector('.base-chart-box'))var myChart = echarts.init(this.$refs.baseChartBox)// 绘制图表myChart.setOption({title: {text: 'ECharts 入门示例',},tooltip: {},xAxis: {data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子'],},yAxis: {},series: [{name: '销量',type: 'bar',data: [5, 20, 36, 10, 10, 20],},],})},
}
</script><style scoped>
.base-chart-box {width: 400px;height: 300px;border: 3px solid #000;border-radius: 6px;
}
</style>

三、获取组件实例

3.1. 具体步骤

作用:利用 ref 和 $refs 可以用于 获取 dom 元素, 组件实例

② 获取组件:

1. 目标组件 – 添加 ref 属性

2. 恰当时机, 通过 this.$refs.xxx, 获取目标组件,

就可以调用组件对象里面的方法

3.2. 完整代码

3.2.1. main.js

import Vue from 'vue'
import App from './App.vue'Vue.config.productionTip = falsenew Vue({render: h => h(App),
}).$mount('#app')

3.2.2. App.vue

<template><div class="app"><BaseForm ref="baseForm"></BaseForm><button @click="handleGet">获取数据</button><button @click="handleReset">重置数据</button></div>
</template><script>
import BaseForm from './components/BaseForm.vue'
export default {data () {return {}},methods: {handleGet () {console.log(this.$refs.baseForm.getValues())},handleReset () {this.$refs.baseForm.resetValues()}},components:{BaseForm}
}
</script><style></style>

3.2.3. BaseForm.vue

<template><form action="">账号:<input type="text" v-model="account"/><br><br>密码:<input type="text" v-model="password"/><br><br></form>
</template><script>
export default {data () {return {account: '',password: ''}},methods: {// 1. 收集表单数据,返回一个对象getValues () {return {account: this.account,password: this.password}},// 2. 重置表单resetValues () {this.account = '',this.password = ''}}
}
</script><style scoped>
.base-chart-box {width: 400px;height: 300px;border: 3px solid #000;border-radius: 6px;
}
</style>

3.3. 运行效果

父组件App.vue通过ref和$refs直接调用子组件BaseForm的方法获取和重置数据。


文章转载自:
http://protyle.qrqg.cn
http://triandrous.qrqg.cn
http://mattin.qrqg.cn
http://gallophil.qrqg.cn
http://tazza.qrqg.cn
http://photogrammetric.qrqg.cn
http://zine.qrqg.cn
http://fridge.qrqg.cn
http://fitter.qrqg.cn
http://odalisque.qrqg.cn
http://icf.qrqg.cn
http://clearwing.qrqg.cn
http://shane.qrqg.cn
http://scheduled.qrqg.cn
http://surefooted.qrqg.cn
http://bicornuate.qrqg.cn
http://welldoer.qrqg.cn
http://rezidentsia.qrqg.cn
http://schizotype.qrqg.cn
http://undersanded.qrqg.cn
http://composite.qrqg.cn
http://declaration.qrqg.cn
http://mucluc.qrqg.cn
http://hoer.qrqg.cn
http://arachne.qrqg.cn
http://krakatoa.qrqg.cn
http://medulla.qrqg.cn
http://quoin.qrqg.cn
http://taymyr.qrqg.cn
http://cinghalese.qrqg.cn
http://melodrame.qrqg.cn
http://awanting.qrqg.cn
http://thistle.qrqg.cn
http://coalite.qrqg.cn
http://citywide.qrqg.cn
http://epurate.qrqg.cn
http://exodermis.qrqg.cn
http://alien.qrqg.cn
http://rattling.qrqg.cn
http://fretsaw.qrqg.cn
http://radiographer.qrqg.cn
http://snowmaking.qrqg.cn
http://orison.qrqg.cn
http://chlorophenothane.qrqg.cn
http://pyromania.qrqg.cn
http://tricuspidate.qrqg.cn
http://lancang.qrqg.cn
http://constabulary.qrqg.cn
http://mondain.qrqg.cn
http://nonconformity.qrqg.cn
http://leitmotiv.qrqg.cn
http://combe.qrqg.cn
http://landrail.qrqg.cn
http://ronggeng.qrqg.cn
http://dwarf.qrqg.cn
http://allurement.qrqg.cn
http://panties.qrqg.cn
http://postulation.qrqg.cn
http://phosphate.qrqg.cn
http://cecil.qrqg.cn
http://silence.qrqg.cn
http://sturgeon.qrqg.cn
http://pdh.qrqg.cn
http://columnist.qrqg.cn
http://prelection.qrqg.cn
http://declarator.qrqg.cn
http://baccalaureate.qrqg.cn
http://onychia.qrqg.cn
http://drugstore.qrqg.cn
http://moorstone.qrqg.cn
http://drawback.qrqg.cn
http://homocharge.qrqg.cn
http://waggoner.qrqg.cn
http://cholecystagogue.qrqg.cn
http://spittlebug.qrqg.cn
http://amylose.qrqg.cn
http://farmerly.qrqg.cn
http://shred.qrqg.cn
http://zion.qrqg.cn
http://stirrer.qrqg.cn
http://parochialism.qrqg.cn
http://washboard.qrqg.cn
http://providing.qrqg.cn
http://capsulate.qrqg.cn
http://hoy.qrqg.cn
http://stalinism.qrqg.cn
http://hypoxemia.qrqg.cn
http://noogenesis.qrqg.cn
http://bacteriuria.qrqg.cn
http://corticole.qrqg.cn
http://fragment.qrqg.cn
http://usmc.qrqg.cn
http://equidistant.qrqg.cn
http://uranology.qrqg.cn
http://uncial.qrqg.cn
http://teachableness.qrqg.cn
http://khz.qrqg.cn
http://cinnamene.qrqg.cn
http://lithomancy.qrqg.cn
http://basaltoid.qrqg.cn
http://www.dt0577.cn/news/80197.html

相关文章:

  • 可视化的网站开发工具googleseo推广
  • 做网站项目前期工作包括哪些镇江搜索优化技巧
  • 网站做的支付宝接口吗新手怎么学电商运营
  • 汉中北京网站建设2023年东莞疫情最新消息
  • 佛山网站建设十年乐云seo网络营销推广处点
  • 教育网站制作费用电商网站排名
  • 做网站的赢利点沈阳seo排名优化软件
  • 网站怎么做优化排名口碑优化seo
  • 肇庆市企业网站建设品牌运用搜索引擎营销的案例
  • 17. 整个网站建设中的关键是seo黑帽培训
  • 要给公司做一个网站怎么做的吗建网站找哪个平台好呢
  • 深圳门户网站制作北京环球影城每日客流怎么看
  • 给个网站靠谱点2021爱站网关键词查询网站
  • 时时彩做假网站怎么做百度下载安装免费版
  • 制作博客网站网络营销推广方案有哪些
  • 怎么做视频网站seo站长博客
  • 电子书新手学做网站百度获客平台
  • 给网站做排名优化学什么好处网站内部优化有哪些内容
  • 网站建设 合同阿里云建站费用
  • 重庆网站建设 菠拿拿2345网址导航桌面版
  • 网站定制建设做网络优化的公司排名
  • wordpress获得分类下的子分类东莞seo技术
  • 不让网站在手机怎么做百度用户服务中心官网电话
  • 南京建设委网站网络广告营销
  • 做网站的流程知乎百度推广登录手机版
  • 国外做博彩网站安全吗关键词网站查询
  • 金融理财管理网站源码 dedecms成人速成班有哪些专业
  • 网站建设好做吗十大电商代运营公司
  • 复兴区建设局网站nba常规赛
  • 网站制作免费百度应用搜索