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

门户网站html模板全景图网站怎么做

门户网站html模板,全景图网站怎么做,猎头公司全称,网站模板编辑器一、Composition API优势 相对于vue2的option API Vue3的Composition API设计更有优势 Composition(组合式)Api 功能分组 Composition(组合式)Api 功能导入复用 组合式Api 所解决的问题 (1) 更好的代码组织结构 (2) 相同的代码逻辑可以进行复用 home.vue 3种方式递进升级…一、Composition API优势 相对于vue2的option API Vue3的Composition API设计更有优势 Composition(组合式)Api 功能分组 Composition(组合式)Api 功能导入复用 组合式Api 所解决的问题 (1) 更好的代码组织结构 (2) 相同的代码逻辑可以进行复用 home.vue 3种方式递进升级 templatediv classhomedivp{{ name }}/pbutton clickgetName姓名/button/divdivp{{ age }}/pbutton clickgetAge年龄/button/div/divHomeB/HomeB /templatescript // is an alias to /src import HelloWorld from /components/HelloWorld.vue; import HomeB from ./HomeB.vue; // import { ref } from vue; import { useName, useAge } from ./user;export default {name: Home,setup() {// 1.Composition(组合式)Api// const people {// name: yusir,// age: 18,// };// const name ref();// const getName () {// name.value people.name;// };// const age ref();// const getAge () {// age.value people.age;// };// return {// name,// getName,// age,// getAge,// };/* ------------------------ */// 2.Composition(组合式)Api 功能分组// const people {// name: yusir,// age: 18,// };// return {// ...useName(people), //展开运算符// ...useAge(people),// };// function useName(people) {// const name ref();// const getName () {// name.value people.name;// };// return {// name,// getName,// };// }// function useAge(people) {// const age ref();// const getAge () {// age.value people.age;// };// return {// age,// getAge,// };// }/* ------------------------ */// 3.Composition(组合式)Api 功能导入复用// 组合式Api 所解决的问题// (1) 更好的代码组织结构// (2) 相同的代码逻辑可以进行复用const people {name: yusir,age: 18,};return {...useName(people), //展开运算符...useAge(people),};},components: {HelloWorld,HomeB,}, };/scriptHomeB.vue templatediv classhomedivp{{ name }}/pbutton clickgetName姓名/button/divdivp{{ age }}/pbutton clickgetAge年龄/button/div/div /template script import { useName, useAge } from ./user;export default {name: HomeB,setup() {const people {name: yusirxiaer,age: 19,};return {...useName(people), //展开运算符...useAge(people),};}, }; /script style langless scoped/styleuser.js import {ref } from vue export function useName(people) {const name ref();const getName () {name.value people.name;};return {name,getName,}; } export function useAge(people) {const age ref();const getAge () {age.value people.age;};return {age,getAge,}; } 二、setup 入口函数 1.组件创建之前被调用  setup 先于created执行this指向windows created()里打印的this 是proxy对象 指向组件实例 setup函数参数  Props Context (看HomeB子组件) Context JavaScript对象 context.attrs: Attribute属性(非响应式对象)非props数据context.slots: 插槽非响应式对象context.emit: 触发事件的方法  this.$emit 2.this不会只指向当前组件实例 3.返回值 返回一个对象,对象的属性可以直接在模板中进行使用就像Vue2使用data和methods一样 看代码例子 Home.vue  templateHomeB :titletitle desc父组件传递过来的普通属性 updateupdateh1普通的匿名插槽/h1h2{{ title }}/h2/HomeB /templatescript // is an alias to /src import HomeB from ./HomeB.vue;export default {name: Home,setup() {},data() {return {title: 父组件的title,};},created() {console.log(created()打印this);console.log(this);},methods: {update(newTitle) {this.title newTitle;},},components: {HomeB,}, };/scriptHomeB.vue templatediv classhomeB/div /template script export default {name: HomeB,props: {title: {type: String,required: true,},},setup(props, { attrs, slots, emit }) {console.log(props:, props);console.log(Attribute (非响应式的对象):, attrs);console.log(插槽:, slots.default());emit(update, 子组件更新数据的事件);}, }; /script style langless scoped/style
http://www.pierceye.com/news/354953/

相关文章:

  • wordpress网站使用教程aspnet东莞网站建设多少钱
  • 网站地图提交给百度证券公司如何拉客户
  • 做外贸有哪些免费的网站win7优化大师好不好
  • 网站功能怎么写上海网站制作建设怎么样
  • 网站域名是网站架构吗成都网站搭建优化推广
  • 自己做的网站添加交费功能合肥有什么好的网站建设公司好
  • 做网站品牌龙岩新增病例行动轨迹
  • 任家房网站建设郑州百度网站推广
  • 深圳建设网站的公司简介WordPress多功能投稿
  • 简述织梦网站上传及安怎样在网站上做免费的推广
  • 关于信用体系建设的网站wordpress新闻类模板下载
  • 免费行情软件网站下载大全爱学校vi设计案例
  • 网站外包优化怎样做免费抽皮肤的网站
  • 东八区网站建设网站源码在哪里
  • 重点建设专业 专题网站搜狗官方网站
  • 微信营销工具有哪些使用最佳搜索引擎优化工具
  • 网站推广意识薄弱wordpress授权协议
  • 用php做高中数学题库网站阿里网站建设教程
  • 大兴网站建设公司电话东莞企业网站制作怎么做
  • 网站维护有啥用2021跨境电商最火的产品
  • 专业的东莞网站排名wordpress 客户端使用
  • 做网站需要什么人才网站建设与规划案例
  • 你学做网站学了多久建设网站困难的解决办法
  • 东莞如何搭建网站建设做招聘信息的网站
  • 网站行业认证怎么做安卓开发技术
  • 泉州城乡住房建设厅网站网站运营方案ppt
  • 免费做网站wxp114五种常用的网站推广方法
  • 简单的网站建设找哪个公司新网站seo技术
  • 电子网址怎么创建下载优化大师app
  • 网站上传服务器教程wordpress 开启多用户