[vue]vue-book
我们打算要做这几个模块
首页 列表 收藏 添加
home.vue -->
list.vue -->app.vue --> main.js
安装环境
npm i vue-cli -g
vue init webpack vue-book
选择图标

逐次选择好




新建那几个vue组件

- Home.vue
<template>
<div>home</div>
</template>
<script>
export default {
data() {
return {}
},
methods: {},
computed: {},
componets: {}
}
</script>
<style scoped>
</style>
...
- index.js
import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Add from "../components/Add.vue"
import Collect from "../components/Collect.vue"
import Detail from "../components/Detail.vue"
import Home from "../components/Home.vue"
import List from "../components/List.vue"
Vue.use(Router);
export default new Router({
routes: [
{path: "/add", component: Add},
{path: "/collect", component: Collect},
{path: "/detail", component: Detail},
{path: "/home", component: Home},
{path: "/list", component: List},
]
})
- App.vue
<template>
<div id="app">
<router-view></router-view>
<router-link to="/home">首页</router-link>
<router-link to="/list">列表</router-link>
<router-link to="/collect">收藏</router-link>
<router-link to="/add">添加</router-link>
</div>
</template>
<script>
export default {
name: 'App'
}
</script>
<style> <!-- 公共样式,不带scope -->
* {
margin: 0;
padding: 0;
}
ul li {
list-style: none;
}
a {
text-decoration: none;
}
input button {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
</style>

第二版: Tab.vue隔离
- Tab.vue

<template>
<div>
<router-link to="/home">首页</router-link>
<router-link to="/list">列表</router-link>
<router-link to="/collect">收藏</router-link>
<router-link to="/add">添加</router-link>
</div>
</template>
<style scoped>
</style>
- App.vue
<template>
<div id="app">
<router-view></router-view>
<Tab></Tab>
</div>
</template>
<script>
import Tab from "./base/Tab.vue"
export default {
name: 'app',
components: {
Tab
}
}
</script>
<style>
* {
margin: 0;
padding: 0;
}
ul li {
list-style: none;
}
a {
text-decoration: none;
}
input button {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
</style>
[vue]vue-book的更多相关文章
- Javascript - Vue - vue对象
vue提供了一整套前端解决方案,可以提升企业开发效率 vue的处理过程 app.js 项目入口,所有请求最先进入此模块进行处理 route.js 由app.js调用,处理路由的分发 controlle ...
- Vue - vue.js 常用指令
Vue - vue.js 常用指令 目录: 一. vuejs模板语法之常用指令 1. 常用指令: v-html 2. 常用指令: v-text 3. 常用指令: v-for 4. 常用指令: v-if ...
- 前端开发 Vue Vue.js和Nodejs的关系
首先vue.js 是库,不是框架,不是框架,不是框架. Vue.js 使用了基于 HTML 的模版语法,允许开发者声明式地将 DOM 绑定至底层 Vue 实例的数据. Vue.js 的核心是一个允许你 ...
- [Vue] : Vue概述
什么是Vue.js Vue.js 是目前最火的一个前端框架,React是最流行的一个前端框架. Vue.js 是前端的主流框架之一,和Angular.js.React.js 一起,并成为前端三大主流框 ...
- Property 'validate' does not exist on type 'Element | Element[] | Vue | Vue[]'. Property 'valid...
使用vue-cli 3.0+Element-ui时候,调用form表单校验时候出现的问题是: Property 'validate' does not exist on type 'Element | ...
- Vue Vue.use() / Vue.component / router-view
Vue.use Vue.use 的作用是安装插件 Vue.use 接收一个参数 如果这个参数是函数的话,Vue.use 直接调用这个函数注册组件 如果这个参数是对象的话,Vue.use 将调用 ins ...
- vue & vue router & dynamic router
vue & vue router & dynamic router https://router.vuejs.org/guide/essentials/dynamic-matching ...
- vue & vue router & match bug
vue & vue router & match bug match bugs solution name must be router https://stackoverflow.c ...
- [Vue] vue中setInterval的问题
vue中使用setInterval this.chatTimer = setInterval(() => { console.log(this.chatTimer); this.chatMsg( ...
- [Vue] vue跳转外部链接
问题 vue 跳转外部链接问题,当跳转的时候会添加在当前地址后面 var url = 'www.baidu.com' //跳转1 window.localtion.href = url //跳转2 w ...
随机推荐
- HttpClient详细解释
Http协议的重要性相信不用我多说了,HttpClient相比传统JDK自带的URLConnection,增加了易用性和灵活性(具体区别,日后我们再讨论),它不仅是客户端发送Http请求变得容易,而且 ...
- Python学习(21):Python函数(5):变量作用域与闭包
转自 http://www.cnblogs.com/BeginMan/p/3179040.html 一.全局变量与局部变量 一个模块中,最高级别的变量有全局作用域. 全局变量一个特征就是:除非被删除, ...
- Delphi应用程序的调试(五)其他调试工具
Delphi应用程序的调试(五)其他调试工具 Delphi7中提供了一些附加调试工具来帮助用户检查程序错误.从性能上讲,其中一些工具属于高级调试工具.尽管高级调试工具不像其他工具那样常用,但对于经验丰 ...
- 一起脱去小程序的外套和内衣 - 微信小程序架构解析
版权声明:本文由渠宏伟 原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/760767001484042227 来源:腾云阁 ...
- Android NDK学习(1) 简介
转:http://www.cnblogs.com/fww330666557/archive/2012/12/14/2817385.html 一.What is the NDK? The Android ...
- LeetCode 39 Combination Sum(满足求和等于target的所有组合)
题目链接: https://leetcode.com/problems/combination-sum/?tab=Description Problem: 给定数组并且给定一个target,求出所 ...
- sencha touch Button Select(点击按钮进行选择)扩展
此扩展基于官方selectfield控件修改而来,变动并不大,使用方法类似. 代码如下: Ext.define('ux.SelectBtn', { extend: 'Ext.Button', xtyp ...
- mysql客户端工具
MySQL 数据库不仅提供了数据库的服务器端应用程序,同时还提供了大量的客户端工具程序,如 mysql,mysqladmin,mysqldump 等等,都是大家所熟悉的.虽然有些人对这些工具的功能都已 ...
- SOS does not support the current target architecture解决方法
客户提交一个dump文件,WinDbg加载时出现大量WARNING,加载对应版本的SOS后执行相应命令提示"SOS does not support the current target a ...
- Promise在await报错后,如何继续往下跑...
一.resolve 当a>0时,正常情况依次输出A.B.C console.log("A"); let result = await this.test(); console ...