爲何要在一線城市,由於一切的溫馨終將會被打破,由於新一代的人最不怕的就是學習和接受新的事物,舊的事物將會成爲歷史,也必將被新的所取代javascript
cd ~/Desktop
mkdir node_vue_directive_learningload
cd node_vue_directive_learningload
npm init
sudo npm install koa koa-static
index.jshtml
const serve = require('koa-static'); const Koa = require('koa'); const app = new Koa(); // $ GET /package.json app.use(serve('.')); app.listen(3000); console.log('listening on port 3000');
index.htmlvue
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>ArthurSlog</title> </head> <body> <h1>The static web server by ArthurSlog</h1> </body> </html>
v-on.htmljava
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <!-- 開發環境版本,包含了有幫助的命令行警告 --> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> <title>ArthurSlog</title> </head> <body> <div id="app"> <button v-on:click="counter += 1">Add 1</button> <p>The button above has been clicked {{ counter }} times.</p> </div> <script> new Vue({ el: '#app', data: { counter: 0 } }) </script> </body> </html>
Add 1 The button above has been clicked 0 times.