Vue basic introductory notes 18: naming views to achieve classic layout


Vue basic introductory notes 18: naming views to achieve classic layout

<!DOCTYPE html>
<html lang="en">

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src=""></script>
    <link rel="stylesheet" href="[email protected]/dist/css/bootstrap.min.css"
        integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <script src=""></script>
            margin: 0;
            padding: 0

            width: 100%;
            height: 100px;
            background-color: red;
            width: 30%;
            height: 500px;
            background-color: aqua;
            float: left;
            display: flex;
            width: 70%;
            background-color: yellow;
            height: 500px;
            float: left;

    <div id="app">
        <router-view name='header'></router-view>
        <router-view name='left'></router-view>
        <router-view name='main'></router-view>
        let header = { template: '<h1 class="header">header</h1>' }
        let left = { template: '<h1 class="left">left</h1>' }
        let main = { template: '<h1 class="main">main</h1>' }
        const router = new VueRouter({
            routes: [
                    path: '/', components: {
                        'header': header,
                        'left': left,
                        'main': main
                // { path: '/login', component: login },
                // { path: '/register', component: register }
        var vm = new Vue({
            el: '#app',
            data: {},
            methods: {},
        Vue.config.devtools = true


This work adoptsCC agreement, reprint must indicate the author and the link to this article

Purple smoke from sunshine censer

Recommended Today

Introduction to CGI programming with ruby

Write CGI script: The most basicRubyThe CGI script looks like this: ? 1 2 3 4 5 #!/usr/bin/ruby   puts “HTTP/1.0 200 OK” puts “Content-type: text/html\n\n” puts “<html><body>This is a test</body></html>” If you call this script, test If CGI is uploaded to a UNIX / Linux based web hosting service provider and has appropriate permissions, […]