近一年,测试小团队从无到有再被拆,大势所趋,努力过。
停下脚步整理哈字寄,调整心态,继续学习;想想自己的未来,规划回武汉中。
花点了下班时间学习Vue 和 Django,准备优化下测试平台的架构。
前端Vue和后端Django分离
刚开始接触Vue,直接用:https://github.com/ElementUI/element-starter
- 安装Node.js + yarn + npm
- npm run dev
- npm run build
第一部分:基础知识
- 模板
<template>
<div class="test">
<h1>Hi,Vue.js~</h1>
<!-- 获取数据 -->
<h2>{
{title}}</h2>
</div>
</template>
<script>
import axios from 'axios'
// 外部能引用
export default {
name:"test"
data(){
return {
title:"Hello Vue.js!"
}
}
}
</script>
// scoped 不影响其它域的内容
<style scoped>
</style>
- 引用模板
<!-- 展示模板 -->
<template>
<div id="app">
<test></test>
</div>
</template>
<script>
// 导入组件
import Test from './components/test'
export default {
name: 'app',
components: {
Test
}
}
</script>
<!-- 样式代码 -->
<style>
</style>
- 基础语法
- v-if
- v-else
- v-for
- v-on
- 基本方法