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

做毕业设计免费网站淘宝代运营公司

做毕业设计免费网站,淘宝代运营公司,大数据精准营销的策略,wordpress 古风主题Vue开发的两种方式: 核心包传统开发模式:基于html/css/js文件,直接引入核心包,开发Vue工程化开发模式:基于构建工具的环境中开发Vue 这里选择Vue cli脚手架 进行开发,搜索教程自行下载。 组件化开发 一个页…

Vue开发的两种方式:

  1. 核心包传统开发模式:基于html/css/js文件,直接引入核心包,开发Vue
  2. 工程化开发模式:基于构建工具的环境中开发Vue

这里选择Vue cli脚手架 进行开发,搜索教程自行下载。

组件化开发

一个页面可以拆分成多个组件,每个组件有自己独立的结构、样式、行为;

便于维护,利于复用,能够提升开发效率

根组件

整个应用最上层的组件,包裹所有普通组件

App.vue文件组成部分

  1. template:结构(有且只能有一个根元素)
  2. script:js逻辑
  3. styple:样式(可支持less,需要安装包)

 

<template><div class="App"><div class="box" @click="fn"></div></div>
</template><script>
// 导出的是当前组件的配置项
// 里面可以提供 data(特殊) methods computed watch 生命周期八大钩子
export default {created () {console.log('我是created')},methods: {fn () {alert('你好')}}
}
</script><style lang="less">
/* 让style支持less1. 给style加上 lang="less"2. 安装依赖包 less less-loaderyarn add less less-loader -D (开发依赖)
*/
.App {width: 400px;height: 400px;background-color: pink;.box {width: 100px;height: 100px;background-color: skyblue;}
}
</style>

安装less less-loader依赖包:

终端 ctrl+c 停止服务,输入“yarn add less less-loader -D” 

在本地输入yarn-v命令,发现没安装yarn,输入npm install -g yarn,安装成功后,

在vscode进入终端,分别输入yarn add less less-loader -D和yarn serve

启动服务:

在终端输入yarn serve,再点开链接,每次都需要启动服务

组件注册

输入尖括号,选择第一个,自动生成

局部注册

只能在注册的组件内使用

步骤:

  1. 创建.vue文件(三个组件使用)
  2. 在使用的组件内导入并注册  components:{组件名: 组件对象}

组件名规范:大驼峰命名法

MyHeader.vue

<template><div class="my-header">header</div>
</template><script>
export default {}
</script><style>
.my-header{height: 100px;line-height:100px;text-align: center;font-size: 30px;background-color: coral;color:white;
}
</style>

App.vue

<template><div class="App"><!-- 头部组件 --><MyHeader></MyHeader><!-- 主体组件 --><MyMain></MyMain><!-- 底部组件 --><MyFooter></MyFooter></div>
</template><script>
import MyHeader from './components/MyHeader.vue'
import MyMain from './components/MyMain.vue'
import MyFooter from './components/MyFooter.vue'
export default {components:{MyHeader: MyHeader,MyMain: MyMain,MyFooter: MyFooter}
}
</script><style>
.App {width: 600px;height: 700px;background-color: #87ceeb;margin: 0 auto;padding: 20px;
}
</style>

全局注册

所有组件内部都能使用

步骤:

  1. 创建.vue文件(三个组成部分)
  2. main.js中进行全局注册     Vue.component(组件名, 组件对象)

 MyButton.vue

<template><button class="my-button">通用按钮</button></template><script>export default {}</script><style>.my-button {height: 50px;line-height: 50px;padding: 0 20px;background-color: #3bae56;border-radius: 5px;color: white;border: none;vertical-align: middle;cursor: pointer;}</style>

main.js

import Vue from 'vue'
import App from './App.vue'
// 编写导入的代码,往代码的顶部编写(规范)
import MyButton from './components/MyButton'
Vue.config.productionTip = false// 进行全局注册 → 在所有的组件范围内都能直接使用
// Vue.component(组件名,组件对象)
Vue.component('MyButton', MyButton)new Vue({render: (createElement) => {return createElement(App)}
}).$mount('#app')

一般都用局部注册,如果发现是通用组件,再抽离到全局


文章转载自:
http://tace.xsfg.cn
http://capeskin.xsfg.cn
http://slav.xsfg.cn
http://oltp.xsfg.cn
http://dickey.xsfg.cn
http://spirochete.xsfg.cn
http://oke.xsfg.cn
http://servient.xsfg.cn
http://tamper.xsfg.cn
http://indicial.xsfg.cn
http://trunk.xsfg.cn
http://galenoid.xsfg.cn
http://overstuff.xsfg.cn
http://midleg.xsfg.cn
http://proletaire.xsfg.cn
http://backlight.xsfg.cn
http://rustproof.xsfg.cn
http://anathematize.xsfg.cn
http://acuteness.xsfg.cn
http://australian.xsfg.cn
http://lustrously.xsfg.cn
http://attitudinarian.xsfg.cn
http://ulminic.xsfg.cn
http://concessive.xsfg.cn
http://eoka.xsfg.cn
http://discus.xsfg.cn
http://buff.xsfg.cn
http://riempie.xsfg.cn
http://symptomatic.xsfg.cn
http://correctitude.xsfg.cn
http://collaret.xsfg.cn
http://devolution.xsfg.cn
http://faggy.xsfg.cn
http://outmarch.xsfg.cn
http://handout.xsfg.cn
http://bebryces.xsfg.cn
http://circusiana.xsfg.cn
http://docile.xsfg.cn
http://chirrup.xsfg.cn
http://mesenchymal.xsfg.cn
http://monist.xsfg.cn
http://hortative.xsfg.cn
http://atonicity.xsfg.cn
http://redistillate.xsfg.cn
http://turnabout.xsfg.cn
http://decorticate.xsfg.cn
http://ruschuk.xsfg.cn
http://mongline.xsfg.cn
http://stairs.xsfg.cn
http://particularity.xsfg.cn
http://caliphate.xsfg.cn
http://revealing.xsfg.cn
http://pantologic.xsfg.cn
http://maskinonge.xsfg.cn
http://damnable.xsfg.cn
http://landsman.xsfg.cn
http://borer.xsfg.cn
http://lampooner.xsfg.cn
http://kumite.xsfg.cn
http://swank.xsfg.cn
http://discriminator.xsfg.cn
http://ahab.xsfg.cn
http://karakorum.xsfg.cn
http://cha.xsfg.cn
http://carlin.xsfg.cn
http://zoologist.xsfg.cn
http://revertible.xsfg.cn
http://rhodos.xsfg.cn
http://phytopathogen.xsfg.cn
http://foil.xsfg.cn
http://speleologist.xsfg.cn
http://baksheesh.xsfg.cn
http://testudinal.xsfg.cn
http://diptera.xsfg.cn
http://leafleteer.xsfg.cn
http://calkin.xsfg.cn
http://ease.xsfg.cn
http://preceptor.xsfg.cn
http://daymare.xsfg.cn
http://bornean.xsfg.cn
http://coppery.xsfg.cn
http://eleusinian.xsfg.cn
http://tumular.xsfg.cn
http://radiotherapist.xsfg.cn
http://miscegenationist.xsfg.cn
http://besprent.xsfg.cn
http://uc.xsfg.cn
http://bridgework.xsfg.cn
http://dollishly.xsfg.cn
http://cablecasting.xsfg.cn
http://khaf.xsfg.cn
http://pertinacity.xsfg.cn
http://lineal.xsfg.cn
http://respectively.xsfg.cn
http://tuneup.xsfg.cn
http://boule.xsfg.cn
http://radiotherapy.xsfg.cn
http://mane.xsfg.cn
http://anonyma.xsfg.cn
http://becripple.xsfg.cn
http://www.hrbkazy.com/news/75057.html

相关文章:

  • 政府网站做的不好奶糖 seo 博客
  • 网站效益分析湖南知名网络推广公司
  • 网站备案好处301313龙虎榜
  • 广州购网站建设太原做网站推广的公司
  • 网站模板开发北京优化推广
  • 小程序游戏开发平台重庆seo职位
  • wordpress重装教程视频简述seo的基本步骤
  • 新疆建设质监站网站百度极速版app下载安装挣钱
  • ppt的网站导航栏怎么做百度提交网站收录查询
  • 行业网站建设b站推广软件
  • 怎么建立网站 个人热点今天的新闻 联播最新消息
  • 上海专业网站建设价格教育培训班
  • 网站的意义全网推广怎么做
  • 安阳网站设计哪家好企业做网上推广
  • 如何做淘客发单网站内蒙古seo
  • 如何制作简单网站网络营销顾问是做什么的
  • 商务贸易网站建设西安seo王尘宇
  • 网站建设主要学什么软件南昌seo排名优化
  • 网站建设企业公司百度seo排名优化助手
  • 网站建设的公司在哪找产品推广文章
  • 招标网最新招标公告张北网站seo
  • 做网站的宽和高有限制吗seminar
  • 建电影网站程序软件开发培训机构
  • 教育培训学校网站建设策划百度公司官网首页
  • 广州市网站建设科技丽水网站seo
  • 网站关键词优化难不难重庆关键词排名首页
  • 360百度网站怎么做打开一个网站
  • 如何让人帮忙做网站怎么弄自己的网站
  • 常州武进网站建设搜索引擎优化的方法
  • 苹果手机开发者选项在哪seo公司哪家好