关于Vue的培训
This project is maintained by XDTIC
简易入门培训,主要包括三个内容:
We don’t even care about the dom-tree. See examples below:
With JQuery or Origin-JS:
<p id="name">TIC</p>
-------------
$('#name').text('XDTIC');
document.getElementById('name').innerHTML = 'XDTIC';
Now, with Vue.js:
<p></p>
-------------
app.name = 'XDTIC';
@see
/hello-world/Calculator.vue
Install vue-cli: npm install -g @vue/cli
You need to install an extra plugin:
npm install -g @vue/cli-service-global
Create File /hello-world/HelloVue.vue
:
<template>
<h1>Hello Vue!</h1>
</template>
Use shell command: vue serve /hello-world/HelloVue.vue
, your work will online on http://localhost:8080
Compelete An Vue-Component Like this:
@See
/login-trace/LoginTrace.vue
Use:vue serve ./login-trace/LoginTrace.vue
to preview the example.
Documents you may need:
title
:https://www.w3school.com.cn/tags/att_standard_title.aspv-if
:https://cn.vuejs.org/v2/guide/conditional.htmlv-for
:https://cn.vuejs.org/v2/guide/list.htmlvue-component
:https://cn.vuejs.org/v2/guide/components-registration.htmlprops
:https://cn.vuejs.org/v2/guide/components-props.htmlv-bind
:https://cn.vuejs.org/v2/guide/class-and-style.htmlcomputed
:https://cn.vuejs.org/v2/guide/computed.htmlThere is a demo here: /login-trace/LoginTrace.vue
vue cli
, follow this, after generating a vue-project successfully, you will see:All you need to install are:
vuex
: Centralized State Management for Vue.js. @See https://vuex.vuejs.org/zhvue-router
: Vue Router is the official router for Vue.js. @See https://router.vuejs.org/zhiview
: A high quality UI Toolkit based on Vue.js. @See https://www.iviewui.com@See https://cli.vuejs.org/zh/config/
As a beginner, use default configure.
Or with shell:
npm run serve
.
Open your browser, enter http://localhost:8080/。 Demo is online: