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

WordPress需要什么配置张家口网站seo

WordPress需要什么配置,张家口网站seo,旅游局网站建设方案,活动策划公司主要做什么Vue3 create-vue搭建Vue3项目 注意要使用nodejs16.0版本以上,windows升级node可以西安使用where node查看本地node位置,然后到官网下载msi文件,在本地路径下安装即可 安装完可以使用node -v检查版本信息 项目目录和关键文件 组合式API - s…

Vue3

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

create-vue搭建Vue3项目

在这里插入图片描述在这里插入图片描述
注意要使用nodejs16.0版本以上,windows升级node可以西安使用where node查看本地node位置,然后到官网下载msi文件,在本地路径下安装即可
在这里插入图片描述
安装完可以使用node -v检查版本信息
在这里插入图片描述

项目目录和关键文件

在这里插入图片描述

组合式API - setup选项

在这里插入图片描述

<script>
// setup函数
// 1. 执行时机:比beforeCreate还要早
// 2. setup函数中,获取不到this(this是undefined)
export default{setup(){// console.log('setup函数',this);},beforeCreate(){console.log('beforeCreate函数');}
}
</script><template><div>学习Vue3</div>
</template>

在这里插入图片描述
在这里插入图片描述

<script>
// setup函数
// 1. 执行时机:比beforeCreate还要早
// 2. setup函数中,获取不到this(this是undefined)
// 3. 数据和函数,需要在setup最后return才能在模板中应用
export default{setup(){// console.log('setup函数',this);// 数据const message = 'hello Vue3'// 函数const logMessage = () => {console.log(message)}return {message,logMessage}},beforeCreate(){console.log('beforeCreate函数');}
}
</script><template><div>{{ message }}</div><button @click="logMessage">按钮</button>
</template>

在这里插入图片描述

在这里插入图片描述

<!-- <script>
// setup函数
// 1. 执行时机:比beforeCreate还要早
// 2. setup函数中,获取不到this(this是undefined)
// 3. 数据和函数,需要在setup最后return才能在模板中应用
export default{setup(){// console.log('setup函数',this);// 数据const message = 'hello Vue3'// 函数const logMessage = () => {console.log(message)}return {message,logMessage}},beforeCreate(){console.log('beforeCreate函数');}
}
</script> --><script setup>
const message = 'hello Vue3'
const logMessage=()=>{console.log(message)
}
</script><template><div>{{ message }}</div><button @click="logMessage">按钮</button>
</template>

在这里插入图片描述

在这里插入图片描述

组合式API - reactive和ref函数

reactive()

在这里插入图片描述

<script setup>
// reactive语法:接受对象类型数据的参数传入,并返回一个响应式的对象
import { reactive } from 'vue';
const state = reactive({count:100
})
const setCount=()=>{state.count++
}
</script><template><div><div>{{ state.count }}</div><button @click="setCount">+1</button></div>
</template>

在这里插入图片描述

ref()

在这里插入图片描述

<script setup>
// reactive语法:接受对象类型数据的参数传入,并返回一个响应式的对象
// import { reactive } from 'vue';
// const state = reactive({
//   count:100
// })
// const setCount=()=>{
//   state.count++
// }// 如果是简单类型,怎么办?
// 脚本中访问数据,需要通过value
// 在template中,.value不需要加
import { ref } from 'vue'
const count = ref(0)
const setCount=()=>{count.value++
}
</script><template><div><div>{{ count }}</div><button @click="setCount">+1</button></div>
</template>

在这里插入图片描述
日后编码统一使用ref()
在这里插入图片描述

组合式API - computed

在这里插入图片描述
在这里插入图片描述

<script setup>
// const 计算属性 = computed(() => {return计算返回的结果})import { computed, ref } from "vue";
// 声明数据
const list = ref([1, 2, 3, 4, 5, 6, 7, 8]);// 基于list派生一个计算属性,从list中过滤出大于2
const computedList = computed(() => {return list.value.filter((item) => item > 2);
});// 定义一个修改数组的方法
const addFn=()=>{list.value.push(666)
}
</script><template><div>原始数据:{{ list }}</div><div>计算后的数据:{{ computedList }}</div><button @click="addFn" type="button">修改</button>
</template>

在这里插入图片描述

在这里插入图片描述

组合式API - watch

在这里插入图片描述

基础使用 - 侦听单个数据

在这里插入图片描述

基础使用 - 侦听多个数据

在这里插入图片描述

<script setup>
import {ref,watch} from 'vue'
const count = ref(0)
const nickname = ref('张三')const changeCount=()=>{count.value++
}
const changeName=()=>{nickname.value = '里四'
}// 1.监视单个数据的变化
// watch(ref对象,(newValue,oldValue)=>{...})
watch(count,(newValue,oldValue)=>{console.log(newValue,oldValue)
})
// 2.监视多个数据的变化
// watch([ref对象1,ref对象2],(newArr,oldArr)=>{...})
watch([count,nickname],(newArr,oldArr)=>{console.log(newArr,oldArr)
})
</script><template><div>{{ count }}</div><button @click="changeCount">改数字</button><div>{{ nickname }}</div><button @click="changeName">改昵称</button>
</template>

在这里插入图片描述

immediate

在这里插入图片描述

deep

在这里插入图片描述

<script setup>
import {ref,watch} from 'vue'
const count = ref(0)
const nickname = ref('张三')const changeCount=()=>{count.value++
}
const changeName=()=>{nickname.value = '里四'
}// 1.监视单个数据的变化
// watch(ref对象,(newValue,oldValue)=>{...})
// watch(count,(newValue,oldValue)=>{
//   console.log(newValue,oldValue)
// })// 2.监视多个数据的变化
// watch([ref对象1,ref对象2],(newArr,oldArr)=>{...})
// watch([count,nickname],(newArr,oldArr)=>{
//   console.log(newArr,oldArr)
// })// 3.immediate立即执行
// watch(count,(newValue,oldValue)=>{
//   console.log(newValue,oldValue)
// },{
//   immediate:true
// })// 4.deep深度监视:默认watch进行的是浅层监视
const useInfo = ref({name:'张三',age:18
})
const setUserInfo=()=>{// 修改了useInfo.value 修改了对象的地址,才能监视到// useInfo.value = {name : 'ls',age:50}useInfo.value.age++
}
watch(useInfo,(newValue)=>{console.log(newValue)
},{deep:true
})
</script><template><div>{{ count }}</div><button @click="changeCount">改数字</button><div>{{ nickname }}</div><button @click="changeName">改昵称</button><div>{{ useInfo }}</div><button @click="setUserInfo">修改userInfo</button>
</template>

在这里插入图片描述

精确侦听对象的某个属性

在这里插入图片描述

<script setup>
import {ref,watch} from 'vue'
const count = ref(0)
const nickname = ref('张三')const changeCount=()=>{count.value++
}
const changeName=()=>{nickname.value = '里四'
}// 1.监视单个数据的变化
// watch(ref对象,(newValue,oldValue)=>{...})
// watch(count,(newValue,oldValue)=>{
//   console.log(newValue,oldValue)
// })// 2.监视多个数据的变化
// watch([ref对象1,ref对象2],(newArr,oldArr)=>{...})
// watch([count,nickname],(newArr,oldArr)=>{
//   console.log(newArr,oldArr)
// })// 3.immediate立即执行
// watch(count,(newValue,oldValue)=>{
//   console.log(newValue,oldValue)
// },{
//   immediate:true
// })// 4.deep深度监视:默认watch进行的是浅层监视
const useInfo = ref({name:'张三',age:18
})
const setUserInfo=()=>{// 修改了useInfo.value 修改了对象的地址,才能监视到// useInfo.value = {name : 'ls',age:50}useInfo.value.age++
}// 4. deep深度监视 
// watch(useInfo,(newValue)=>{
//   console.log(newValue)
// },{
//   deep:true
// })// 5. 对于对象中的属性,进行监视
watch(()=>useInfo.value.age,(newValue,oldValue)=>{console.log(newValue,oldValue)
})
</script><template><div>{{ count }}</div><button @click="changeCount">改数字</button><div>{{ nickname }}</div><button @click="changeName">改昵称</button><div>{{ useInfo }}</div><button @click="setUserInfo">修改userInfo</button>
</template>

在这里插入图片描述

在这里插入图片描述

组合式API - 生命周期函数

在这里插入图片描述

生命周期函数基本使用

在这里插入图片描述

执行多次

在这里插入图片描述

<script setup>import { onMounted } from 'vue';
// beforeCreated 和 created 的相关代码放在 setup 中执行
const getList = () =>{setTimeout(()=>{console.log('发送请求,获取数据')},2000)
}// 已进入页面的请求
getList()// 如果有写代码需要在mounted生命周期中执行
onMounted(()=>{console.log('mounted生命周期函数')
})
// 可调用多次,不会冲突,按照顺序依次执行
onMounted(()=>{console.log('mounted生命周期函数1')
})
</script><template><div></div>
</template>

在这里插入图片描述

在这里插入图片描述

组合式API - 父子通信

组合式API下的父传子

在这里插入图片描述

<script setup>
// 注意:由于写了setup,所以无法直接配置props
// 此处要借助于编译器宏函数接收
const props = defineProps({car:String,money:Number
})
console.log(props.car)
console.log(props.money)
</script><template><div class="son">我是子组件 - {{ car }}</div>
</template><style scoped>
.son {border: 1px solid #000;padding: 30px;
}</style>
<script setup>
import SonCom from '@/components/son-com.vue'
import {ref} from 'vue'
// 局部组件导入进来就能用
const money = ref(100)
const getMoney = () => {money.value+=10
}
</script><template><div><h1>父组件 - {{ money }}<button @click="getMoney">挣钱</button></h1><!-- 给子组件,以添加属性的方式传值 --><SonCom car="宝马车" :money="money"></SonCom></div>
</template>

在这里插入图片描述

在这里插入图片描述

组合式API下的子传父

在这里插入图片描述
在这里插入图片描述

组合式API - 模版引用

在这里插入图片描述

如何使用(以获取dom为例 组件同理)

在这里插入图片描述

defineExpose()

在这里插入图片描述
在这里插入图片描述

组合式API - provide和inject

在这里插入图片描述

跨层传递普通数据

在这里插入图片描述

跨层传递响应式数据

在这里插入图片描述

跨层传递方法

在这里插入图片描述

<script setup>
import CenterCom from "@/components/center-com.vue";
import { provide, ref } from "vue";// 1.跨层传递普通数据
provide("theme-color", "pink");// 2.跨层传递响应式数据
const count = ref(100);
provide("count", count);setTimeout(() => {count.value = 500;
}, 2000);// 3.跨层级传递函数,给子孙后代传递可以修改数据的方法
provide("changeCount", (newCount) => {count.value = newCount;
});
</script><template><div><h1>顶层组件</h1><CenterCom></CenterCom></div>
</template>
<script setup>
import BottomCom from './bottom-com.vue'</script><template><div><h2>中间组件</h2><BottomCom></BottomCom></div>
</template>
<script setup>
import {inject} from 'vue'
const themeColor = inject('theme-color')
const count = inject('count')
const changeCount = inject('changeCount')
const clickFn=()=>{changeCount(1000)
}
</script><template><div><h3>底层组件 - {{ themeColor }} - {{ count }}</h3><button @click="clickFn">更新count</button></div>
</template>

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

Vue3.3新特性-defineOptions

在这里插入图片描述
在这里插入图片描述

Vue3.3新特性-defineModel

在这里插入图片描述


文章转载自:
http://dinncogelignite.wbqt.cn
http://dinncoautocracy.wbqt.cn
http://dinncocoextension.wbqt.cn
http://dinncoscrotitis.wbqt.cn
http://dinncogarderobe.wbqt.cn
http://dinncocarnotite.wbqt.cn
http://dinncohairpin.wbqt.cn
http://dinncoshambles.wbqt.cn
http://dinncoqueensland.wbqt.cn
http://dinncomehetabel.wbqt.cn
http://dinncotogue.wbqt.cn
http://dinncooffprint.wbqt.cn
http://dinncocorymbous.wbqt.cn
http://dinncoinsufferable.wbqt.cn
http://dinncoquashy.wbqt.cn
http://dinncoreast.wbqt.cn
http://dinncostructureless.wbqt.cn
http://dinncotattler.wbqt.cn
http://dinncomolokai.wbqt.cn
http://dinncodolomite.wbqt.cn
http://dinncohydrid.wbqt.cn
http://dinncodedicatory.wbqt.cn
http://dinncomascot.wbqt.cn
http://dinncoliterature.wbqt.cn
http://dinncobiomedicine.wbqt.cn
http://dinncocascade.wbqt.cn
http://dinncocarcajou.wbqt.cn
http://dinncoserialise.wbqt.cn
http://dinncoceliac.wbqt.cn
http://dinncoecbolic.wbqt.cn
http://dinncogeocorona.wbqt.cn
http://dinncosemirural.wbqt.cn
http://dinncopodsolisation.wbqt.cn
http://dinncohellion.wbqt.cn
http://dinncobladderwort.wbqt.cn
http://dinncoaloft.wbqt.cn
http://dinncosingularity.wbqt.cn
http://dinncoverve.wbqt.cn
http://dinncokiekie.wbqt.cn
http://dinncohistologist.wbqt.cn
http://dinncodiathermal.wbqt.cn
http://dinncocytogenetics.wbqt.cn
http://dinncogirder.wbqt.cn
http://dinncolidar.wbqt.cn
http://dinncohostility.wbqt.cn
http://dinncopimpled.wbqt.cn
http://dinncoarthrology.wbqt.cn
http://dinncoclung.wbqt.cn
http://dinnconaturphilosoph.wbqt.cn
http://dinncoassoeted.wbqt.cn
http://dinncoatapi.wbqt.cn
http://dinncostereometry.wbqt.cn
http://dinncojawed.wbqt.cn
http://dinncoagreeably.wbqt.cn
http://dinncotintinnabulation.wbqt.cn
http://dinncocleavable.wbqt.cn
http://dinncopullicat.wbqt.cn
http://dinncocollected.wbqt.cn
http://dinncodogra.wbqt.cn
http://dinncokimono.wbqt.cn
http://dinncowhiz.wbqt.cn
http://dinncorockily.wbqt.cn
http://dinncofastness.wbqt.cn
http://dinncoflax.wbqt.cn
http://dinncostrict.wbqt.cn
http://dinncounderlife.wbqt.cn
http://dinncosleighing.wbqt.cn
http://dinncopiston.wbqt.cn
http://dinncopinkerton.wbqt.cn
http://dinncoresolve.wbqt.cn
http://dinncotefl.wbqt.cn
http://dinncobiodynamic.wbqt.cn
http://dinncoasternal.wbqt.cn
http://dinncoreleaser.wbqt.cn
http://dinncopirouette.wbqt.cn
http://dinncopraecipe.wbqt.cn
http://dinncotestacy.wbqt.cn
http://dinncoautotomy.wbqt.cn
http://dinncomycophilic.wbqt.cn
http://dinncoseismonasty.wbqt.cn
http://dinncohooklet.wbqt.cn
http://dinncodyne.wbqt.cn
http://dinncofrantically.wbqt.cn
http://dinncoinker.wbqt.cn
http://dinncosyconium.wbqt.cn
http://dinncocomte.wbqt.cn
http://dinncosowback.wbqt.cn
http://dinncotorchon.wbqt.cn
http://dinncoextine.wbqt.cn
http://dinncoskeletogenous.wbqt.cn
http://dinncostacker.wbqt.cn
http://dinncoepoch.wbqt.cn
http://dinncofend.wbqt.cn
http://dinncodemesne.wbqt.cn
http://dinncoenzygotic.wbqt.cn
http://dinncofarsi.wbqt.cn
http://dinncofaroese.wbqt.cn
http://dinncocroat.wbqt.cn
http://dinncocagliari.wbqt.cn
http://dinncoseptarium.wbqt.cn
http://www.dinnco.com/news/155248.html

相关文章:

  • 国泰君安官方网站建设集团搜狗友链交换
  • 百度安装app下载免费seo免费视频教程
  • 网站放假通知网络营销文案实例
  • 找我家是做的视频网站知名网站
  • 企业信息公示系统查询全国官网成都seo技术
  • 单人做网站需要掌握哪些知识网站子域名查询
  • 如何做网商商城的网站长沙网站seo收费标准
  • 杭州做网站怎么收费企业qq怎么申请
  • 手机端模板网站网络推广外包公司干什么的
  • 厚街网站仿做网络推广靠谱吗
  • 如何做网课网站新闻头条最新消息今日头条
  • 做家教网站怎么样seo专员是什么意思
  • 南昌住房建设局网站网站上不去首页seo要怎么办
  • 吴江高端网站建设福州网站开发公司
  • 沧州做网站最好的公司短视频运营
  • 团购网站为什么做不走自己的网站怎么在百度上面推广
  • 沧州市网站建设电话中国最好的营销策划公司
  • 做网站租服务器佛山网站建设公司
  • 青岛做网站公司百度seo关键词优化排名
  • 十大网站app排行榜线上销售平台有哪些
  • 在线生成sitemap网站的网址企业官网网站
  • 设计师 个人网站网络营销和网络推广有什么区别
  • 凡科做的网站怎么样最近最新新闻
  • wordpress 被黑后长沙网站优化
  • 建网站公司联系方式绍兴seo外包
  • 免费asp网站模板怎么注册自己公司的网址
  • 国外创意摄影网站seo臻系统
  • 专门做ppt的网站名称百度推广下载安装
  • 建设银行企业网银缴费国内seo排名
  • 做刷单哪个网站找小白百搜科技