随笔分类 - Vue
摘要:1、下载axios npm install axios --save 2、在main中导入:这样就能全局以this.$axios方式使用axios import axios from 'axios' Vue.prototype.$axios = axios 3、使用 //在模板渲染成html之前调用
阅读全文
摘要:vuex 的几个核心概念Store:Vuex 使用一个 Store 对象管理应用的状态,一个 Store 包括 State, Getter, Mutation, Action 四个属性。 State:State 意为“状态”,是 vuex 状态管理的数据源。 Getter:Getter 的作用与 f
阅读全文
摘要:一、注册vue-router import VueRouter from 'vue-router' Vue.use(VueRouter); 二、创建 router 实例并routes 定义路由 const router = new VueRouter({ mode:"history", routes
阅读全文
摘要:安装marked npm install marked --save 1、创建输入和转换面板 <div class="app"> <div class="mark"> <div class="edit"> <textarea class="marked_data" name="marked_data
阅读全文
摘要:组件使用 一、创建组件 三个模板,template、script、style分别对应html、js、css template中只能有一个父标签,不能并列多个父标签 script必须export 一个默认函数,拥有name属性和data方法,data必须有返回值 style标签最好加入scoped属性
阅读全文
摘要:启动错误基本是与scripts配置有关: 情况1: 启动目录错误,cd到正确的项目目标 情况2: package.json中的scripts参数根本没有启动配置,或者package.js里的scripts确实没有dev 解决办法,也适用于解决start, build丢失 1、项目目录下输入vue i
阅读全文
摘要:1、安装nodejs 2、安装脚手架vue-cli 安装前最好先安装淘宝镜像,不然安装速度很慢 # 安装淘宝镜像后npm用cnpm代替,其它命令不变 npm install -g cnpm --registry=https://registry.npm.taobao.org # 全局安装脚手架cnp
阅读全文
摘要:<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Docume
阅读全文
摘要:一、script引包,例如: <script src="../node_modules/vue/dist/vue.js"></script> 二、创建实例化对象 new Vue({ el:"#app", data:{ msg:"hello vue", show:true } }); 三、指令系统 v
阅读全文
摘要:打开Nodejs英文网:https://nodejs.org/en/ 中文网:http://nodejs.cn/ 我们会发现这样一句话: 翻译成中文如下: Node.js 是一个基于 Chrome V8 引擎的 JavaScript 运行环境。 Node.js 使用了一个事件驱动、非阻塞式 I/O
阅读全文
摘要:一、var、let和const 1、var,可以先使用后声明,可以重复定义,可以在块级作用域外使用 console.log(name) { var name = "aike"; var name = '艾克'; } console.log(name) 2、let,只能先声明后使用,不能重复定义,只能
阅读全文

浙公网安备 33010602011771号