Articles under category Vue

Sort out some of the latest gadgets.

You can see that there are two buttons (get verification code, login) two boxes (enter the phone number, enter the verification code).

So we have the following thing (no concrete function, just look at the structure).

 <template>
<div class= "login-wrapper" >
<div class= "title-bar" > login </div>
<div class= "wrapper phone-wrapper" >
<span >
<span "wrapper" > mobile phone number, "mobile phone", "mobile phone", "mobile phone", "mobile phone", "mobile phone", "phone", "password", "password", "password", "password", "authentication", "authentication code", "password", "password", "password", "password", "password", "password", "password", "password", "login".

At this time, you can start writing logic. It is also a simple analysis. Login needs to click, get the verification code need to click and countdown seconds, that is, dynamically modify the text, experience a good check can limit the number of mobile phone number, the number of verification code.

That's almost like this.

 "Title-bar" > login </div>
<div class= "wrapper phone-wrapper" >
<span, ">
<span", "mobile", "mobile", "mobile", "mobile". <template>
<div class= "login-wrapper" >
<div class= The number of 
code: '/ / input box verification code 
codeText:' get the verification code ', / / countdown display text 
timingBoard: 60, / countdown 
timer: null / / timer, used for countdown verification code}}, 
methods: {
loginCode () {}, / / get the verification code 
login () {} / / login 
changePhone () {} / / check cell phone number 
changeCode () {} / / check the length of the verification code 
}
</script>

With these, it is enough for you to implement a basic mobile phone login interface. If you need full code, please click below. Gist links

Complete code is read: Https://gist.github.com/flxxyz/64ceb06a0754d67a771b3e3e7dc94d48

To tell you the truth, I haven't seen API for such a long time. Vue rediscovered my blog these days. Vue.directive It looks great.

Always see here. Vue.use (ElementUi) Where to use Vue.use (Axios) It has always been at the level of application, and I find that the consumption of markdown parsing examples is a little too large. It may be a lot easier to process directives directly.

Describe the process briefly.

The components that render the article will query whether there is a corresponding article in the local record during the lifecycle of the installation. If there is no request, the request will be searched online, otherwise 404.
The article is for the content of markdown, considering that front-end processing can be directly resolved (after all, the front-end performance is over 233), so as to reduce the burden of logical processing on the back end and consistency.
The markdown parser is used. Marked The completion logic is as follows

 //main.js

import Vue from'vue'
import App from'./App'
import markdown from'./markdown';} / / injection of markdown resolver, (()) = (=).

Integrated marked makes plug-in form exposure

 //markdown.js

import marked from'marked'
import ('highlight.js/styles/atom-one-dark.css') 

marked.setOptions ({
renderer: new marked.Renderer ()), 
pedantic: false, 
pedantic:, false, e, R, D, R, D, R, D, R, D, C, C, R, R, R, R, R, R, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, P, etc.

Use on labels V-markdown instructions

 Interface = function (), {
return new new ({}}) = ({}}) =} {} (}) {}}, {}} {}}, {}}, {}}, {}}, {}}, or finding local articles = {}}, (= {}} (=) > {}; this is an interface for searching for articles; {}); (404); //Test.vue

<template>
<div>
<div v-if= "isNotFound" >404</div>
<div v-else v-markdown= "article" ></div>
</div>
</template>

<script>
const, this is a search article. }

return res; {}}, 
mounted () {/ / ID to find articles 
let a = this.handlerArticle (123); 

if (a = = = 404) {/ / jump to error page}} / / processing loading
this.isNotFound = false; = =}; / / save content directly to variable

Complete code is read: Https://gist.github.com/flxxyz/93e009d32ecd7e0c6785a52571577cd7

 Vue.component (component name, {
template: template ID, / / script and template tags can achieve 
props: [pass data parameter], 
methods: {method name: function () {}}};

Single file can be used for reference.

I use it. Import Import no problem, use Webpack When generated, it is found that Vue.component () Registration will report wrong, check find solution, delete new. Components
?

Import XYZ from'./components/head.vue';

When using global registration components, you need to include new in the Components delete

 Vue.component ('xyz ', require ('./components/head.vue')); 

new Vue ({
el:'#app'
//components: {XYZ}}}.
This page loaded in 0.000908 seconds