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

信得过的网站开发推广免费推广引流软件

信得过的网站开发推广,免费推广引流软件,网站 规划,推广网站的方法初始化脚手架 初始化脚手架步骤: 第一步(仅第一次执行):全局安装vue/cli。 命令:npm install -g vue/cli 第二步:切换到要创建项目的目录,然后使用命令创建项目。 命令:vue creat…

初始化脚手架

  • 初始化脚手架步骤:

第一步(仅第一次执行):全局安装@vue/cli。
命令:npm install -g @vue/cli

第二步:切换到要创建项目的目录,然后使用命令创建项目。
命令:vue create xxxx

第三步:启动项目
npm run serve

备注:
如出现下载缓慢请配置npm淘宝镜像:npm config set registry https://registry.npm.taobao.org

Vue脚手架隐藏了所有webpack的相关配置,若想查看具体的webpakc配置,请执行命令:vue inspect > output.js

  • 脚手架文件结构:

├── node_modules
├── public
│ ├── favicon.ico: 页签图标
│ └── index.html: 主页面
├── src
│ ├── assets: 存放静态资源
│ │ └── logo.png
│ │── component: 存放组件
│ │ └── HelloWorld.vue
│ │── App.vue: 汇总所有组件
│ │── main.js: 入口文件
├── .gitignore: git版本管制忽略的配置
├── babel.config.js: babel的配置文件
├── package.json: 应用包配置文件
├── README.md: 应用描述文件
├── package-lock.json:包版本控制文件

  • 关于不同版本的Vue说明:
  1. vue.js与vue.runtime.xxx.js的区别:
    (1)vue.js是完整版的Vue,包含:核心功能 + 模板解析器。
    (2)vue.runtime.xxx.js是运行版的Vue,只包含:核心功能;没有模板解析器。
  2. 因为vue.runtime.xxx.js没有模板解析器,所以不能使用template这个配置项,需要使用render函数接收到的createElement函数去指定具体内容。
  • vue.config.js配置文件说明
  1. 使用vue inspect > output.js可以查看到Vue脚手架的默认配置。
  2. 使用vue.config.js可以对脚手架进行个性化定制,详情见:https://cli.vuejs.org/zh

入门案例

main.js

//该文件是整个项目的入口文件//引入Vue
import Vue from 'vue'
//引入App组件,它是所有组件的父组件
import App from './App.vue'
//关闭vue的生产提示
Vue.config.productionTip = false/* 
关于不同版本的Vue:1.vue.js与vue.runtime.xxx.js的区别:(1).vue.js是完整版的Vue,包含:核心功能+模板解析器。(2).vue.runtime.xxx.js是运行版的Vue,只包含:核心功能;没有模板解析器。2.因为vue.runtime.xxx.js没有模板解析器,所以不能使用template配置项,需要使用render函数接收到的createElement函数去指定具体内容。
*///创建Vue实例对象(vm)
new Vue({el:'#app',//render函数完成了这个功能:将App组件放入容器中render: h => h(App)// render:q=> q('h1','你好啊')// template:`<h1>你好啊</h1>`,// components:{App},})

App.vue

<template><div><img src="./assets/logo.png" alt="logo"><School></School><Student></Student></div>
</template><script>//引入组件import School from './components/School' //引入School组件import Student from './components/Student' //引入Student组件export default {name:'App',components:{School,Student}}</script>

School.vue

<template><div class="demo"><h2>学校名称:{{name}}</h2><h2>学校地址:{{address}}</h2><button @click="showSchoolName">点击弹出学校名称</button>	</div>
</template><script>export default {name:'School',data(){return {name:'替天行道学校',address:'梁山'}},methods: {showSchoolName(){alert(this.name)}},}
</script><style>.demo{background-color: blue;}
</style>

Student.vue

<template><div class="demo"><h2>学校名称:{{name}}</h2><h2>学校地址:{{address}}</h2><button @click="showSchoolName">点击弹出学校名称</button>	</div>
</template><script>export default {name:'School',data(){return {name:'替天行道学校',address:'梁山'}},methods: {showSchoolName(){alert(this.name)}},}
</script><style>.demo{background-color: blue;}
</style>

基础

ref属性

main.js

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

App.vue

<template><div><h6 v-text="message" ref="title"></h6><button ref="btn" @click="showDOM">点击输出上方的DOM元素</button><School ref="sch"/></div></template><script>//引入School组件import School from './components/School'export default {name:'App',components:{School},data() {return {message:'欢迎学习Vue!'}},methods: {showDOM(){console.log(this.$refs.title) //真实DOM元素。console.log(this.$refs.btn) //真实DOM元素。console.log(this.$refs.sch) //School组件的实例对象。}},}</script>

School.vue

<template><div class="school"><h6>学校名称:{{name}}</h6><h6>学校地址:{{address}}</h6></div>
</template><script>export default {name:'School',data() {return {name:'替天行道学校',address:'梁山'}},}
</script><style>.school{background-color: blue;}
</style>

props配置

main.js

//引入Vue
import Vue from 'vue'
//引入App
import App from './App.vue'
//关闭Vue的生产环境提示
Vue.config.productionTip = false//创建vm
new Vue({el:'#app',render: h => h(App)
})

App.vue

<template><div><Student name="潘金莲" gender="" :age="18"/></div>
</template><script>import Student from './components/Student'export default {name:'App',components:{Student}}
</script>

Student.vue

<template><div><h3>{{message}}</h3><h6>学生姓名:{{name}}</h6><h6>学生性别:{{gender}}</h6><h6>学生年龄:{{myAge+1}}</h6><button @click="updateAge">点击修改收到的年龄</button></div>
</template><script>export default {name:'Student',data() {console.log(this)return {message:'我是替天行道的学生',myAge:this.age}},methods: {updateAge(){this.myAge++}},//简单声明接收// props:['name','age','gender'] //接收的同时对数据进行类型限制/* props:{name:String,age:Number,grnder:String} *///接收的同时对数据:进行类型限制+默认值的指定+必要性的限制props:{name:{type:String, //name的类型是字符串required:true, //name是必要的},age:{type:Number,default:99 //默认值},gender:{type:String,required:true}}}</script>

mixin混入(合)

import Vue from 'vue'import App from './App.vue'import {hunhe,hunhe1} from './mixin'Vue.config.productionTip = falseVue.mixin(hunhe)
Vue.mixin(hunhe1)new Vue({el:'#app',render: h => h(App)
})

App.vue

<template><div><Student/><hr><School/></div>
</template><script>import School from './components/School'import Student from './components/Student'export default {name:'App',components:{Student,School}}
</script>

Student.vue

<template><div><h6 @click="showName">学生姓名:{{name}}</h6><h6>学生性别:{{gender}}</h6>{{number}},{{number1}}</div>
</template><script>import {hunhe,hunhe1} from '../mixin'export default {name:'Student',data() {return {name:'宋江',gender:'男'}},mixins:[hunhe,hunhe1]}
</script>

School.vue

<template><div><h6 @click="showName">学校名称:{{name}}</h6><h6>学校地址:{{address}}</h6>{{number}},{{number1}}</div>
</template><script>import {hunhe,hunhe1} from '../mixin'export default {name:'School',data() {return {name:'替天行道学校',address:'梁山',number:8}},mixins:[hunhe,hunhe1],}
</script>

mixin.js

export const hunhe = {methods: {showName(){alert(this.name)}},mounted() {console.log('你好啊!')},
}export const hunhe1 = {data() {return {number:10,number1:11}},
}

插件

plugins.js

export default {install(Vue,x,y,z){console.log(x,y,z)//全局过滤器Vue.filter('mySlice',function(value){return value.slice(0,4)})//定义全局指令Vue.directive('fbind',{//指令与元素成功绑定时(一上来)bind(element,binding){element.value = binding.value},//指令所在元素被插入页面时inserted(element,binding){element.focus()},//指令所在的模板被重新解析时update(element,binding){element.value = binding.value}})//定义混入Vue.mixin({data() {return {number:10,number1:11}},})//给Vue原型上添加一个方法(vm和组件实例对象就都能用了)Vue.prototype.hello = ()=>{alert('你好!')}}}

main.js

import Vue from 'vue'import App from './App.vue'import plugins from './plugins'Vue.config.productionTip = false//应用(使用)插件
Vue.use(plugins,1,2,3)new Vue({el:'#app',render: h => h(App)
})

App.vue

<template><div><School/><hr><Student/></div>
</template><script>import School from './components/School'import Student from './components/Student'export default {name:'App',components:{School,Student}}
</script>

School.vue

<template><div><h6>学校名称:{{name | mySlice}}</h6><h6>学校地址:{{address}}</h6><button @click="test">点击测试一个hello方法</button></div></template><script>export default {name:'School',data() {return {name:'替天行道学校',address:'梁山',}},methods: {test(){this.hello()}},}
</script>

Student.vue

<template><div><h6>学生姓名:{{name}}</h6><h6>学生性别:{{gender}}</h6><input type="text" v-fbind:value="name"></div>
</template><script>export default {name:'Student',data() {return {name:'宋江',gender:'男'}},}
</script>

scoped样式

main.js

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

App.vue

<template><div><h1 class="title">你好啊</h1><School/><Student/></div>
</template><script>import Student from './components/Student'import School from './components/School'export default {name:'App',components:{School,Student}}
</script><style scoped>.title{color: red;}
</style>

School.vue

<template><div class="demo"><h6 class="title">学校名称:{{name}}</h6><h6>学校地址:{{address}}</h6></div>
</template><script>export default {name:'School',data() {return {name:'替天行道学校',address:'梁山',}}}
</script><style scoped>.demo{background-color: blue;}
</style>

Student.vue

<template><div class="demo"><h6 class="title">学生姓名:{{name}}</h6><h6 class="one">学生性别:{{gender}}</h6></div>
</template><script>export default {name:'Student',data() {return {name:'宋江',gender:'男'}}}
</script><style lang="less" scoped>.demo{background-color: pink;.one{font-size: 40px;}}
</style>

案例


文章转载自:
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://.
http://www.tj-hxxt.cn/news/36883.html

相关文章:

  • 合肥在线官网我赢seo
  • 做一回最好的网站网站建站方式有哪些
  • 免费生成ppt的网站微信怎么推广找客源
  • 软件开发技术培训课程成都自然排名优化
  • 公司网站维护怎么做互联网营销软件
  • 响应式自助建站平台谷歌seo网站建设
  • 淄博做网站电话微信附近人推广引流
  • 建站源码下载徐州网页关键词优化
  • 程序员除了做软件是不是就做网站衡阳网站优化公司
  • wordpress主题转换seo职业技能培训班
  • 外贸网站建设szjijie下载百度app
  • 域名的申请流程seo优化排名
  • wifi办理一个月多少钱网站优化排名易下拉系统
  • 如何创建自己的网站营销推广seo
  • WordPress京东自动转链插件北京seo优化wyhseo
  • 广告链接网页怎么做的seo入门培训课程
  • 网站推广要具备什么最火的网络推广平台
  • 网站建设公司赚钱吗排名优化系统
  • 咸阳网站建设电话深圳互联网公司排行榜
  • 微信24小时人工申诉seo搜索引擎优化到底是什么
  • 免费h5生成网站免费行情网站的推荐理由
  • 做网站架构自媒体平台排名
  • 怎么做58同城网站优化网络的软件下载
  • 专业建设网站的企业推广营销
  • 做网站用什么服务器夜夜草
  • 做网站排名赚钱吗海南百度推广开户
  • 淄博北京网站建设微信营销怎么做
  • 手表交易网站互联网下的网络营销
  • 建网站免费搜狗seo
  • 网站描述 修改seo业务培训