Vue--router-->> Project Multi-route nesting-common

Source: Internet
Author: User
<! DOCTYPEHTML> <HTMLlang="en"> <Head> <Metacharset="UTF-8"> <title>vue-router</title> <Linkrel="stylesheet"href="Http://cdn.bootcss.com/bootstrap/3.2.0/css/bootstrap.min.css"> <Scriptsrc="Js/vue.js"></Script> <!---The first step, introduce the source code of Vue-router into---> <Scriptsrc="js/Vue-router.js" ></Script> </Head> <Body> <Divid="App"> <Divclass="Container"> <ulclass="Nav nav-pills"> <!---use Router-link to jump---> <Li><Router-linkto="/index/i"> Home </Router-link></Li> <Li><Router-linkto="/index/b"> Book List </Router-link></Li> <Li><Router-linkto="/index/g"> Games List </Router-link></Li> </ul> <Div> <Router-view></Router-view> </Div> </Div> </Div> <Script>/** * Configuring Routes, using the official Vuerouter * New Vuerouter to get an instance of Vuerouter * passing parameters in Vuerouter (object) * There is a rou in the argument TES Array Properties * This array is an array of objects * Each object is a route state */varRouter=NewVuerouter({Routes: [
            {Path:"/index",Component: {Template:'//Here with anti (single quote) can have code reminders can also use normal single quotes <div><router-view></router-view> </div> ` Template: "<div><router-view></router-view></div>" another way of writing },Children: [
                    {Path:"I",Component: {Template:" }
                    },
                    {Path:"B",Component: {Template:" }
                    },
                    {Path:"G",Component: {Template:" }
                    }
                ]
            }
        ]
    });NewVue({Data: {username:"Andy Lau" },Router:Router }). $mount ("#app"); </Script> </Body> </HTML>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.