首页 终身学习

本教程在上一篇Vue router使用方法的基础上进行

Vue router使用方法

1、在components文件夹中新建三个组件Text1、Text2、Text3
在这里插入图片描述
2、在router.js中引入组件

import Text1 from './components/Text1'
import Text2 from './components/Text2'
import Text3 from './components/Text3'

3、在routes内嵌套children

children: [{
                    path: '/',
                    redirect: 'text1'
                },
                {
                    path: 'text1',
                    component: Text1
                },
                {
                    path: 'text2',
                    component: Text2
                },
                {
                    path: 'text3',
                    component: Text3
                },
            ]

在这里插入图片描述
4、打开浏览器即可显示
在这里插入图片描述




文章评论

    Foot Pedal Fishing Kayak 访客IEWindows
    7小时 前   回复

    Automatic Recyclable Spray Booths
    Foot Pedal Fishing Kayak

    18小时 前   回复

    Competitive Price for Vibrating Love Eggs - Cock sleeve - Kaiwei
    ITO Conductive Glass Coating Equipment

    22小时 前   回复

    Flower Gift
    Slim Bathroom Vanity Furniture Cabinets

    kitchen 2 pac panel 访客IEWindows
    1天 前   回复

    Motion Sensor Light Bulb
    kitchen 2 pac panel

    1天 前   回复

    Gym Flooring For Garage
    Kitchen Cabinet Set Complete

    1天 前   回复

    Good quality Cast Iron Griddle Pan - Round Casserole Set Kitchen Cookware Cast Iron Enamel Pot With Lid - DEBIEN
    White Cabinet Upper Door Kitchen Storage Cabinet

    1天 前   回复

    Electrolytic Polisher
    Clean Water Pump in Plastic Casing

    1天 前   回复

    Grow Bags For Plants
    Boost Pressure System with Plastic Housing FGPXXX5JC

    Flaschensterilisator 访客IEWindows
    1天 前   回复

    Bait Runner Fishing Reel
    Flaschensterilisator

    Washroom Vanity 访客IEWindows
    2天 前   回复

    Brake Disc Pad
    Washroom Vanity

    Body Foundation 访客IEWindows
    3天 前   回复

    Elegant Walk in Closet
    Body Foundation

    Cogent Coil Tubing 访客IEWindows
    3天 前   回复

    Tall Kitchen Cupboard
    Cogent Coil Tubing

    3天 前   回复

    Amines
    Hanger Shot Blasting Machine

    3天 前   回复

    Kitchen Benchtop Installation
    Led Advertising Display Panel

    3天 前   回复

    Li Polymer Cylindrical Battery
    Electrical Cable Warning Tape

    Clofentezine 10% Wp 访客IEWindows
    3天 前   回复

    Mercaptan Based Hardeners
    Clofentezine 10% Wp

    4天 前   回复

    China Equipment/Production Line
    Bolt Cleaning and Derusting Shot Blasting Machine

    4天 前   回复

    Exterior Bamboo Wall
    LED Decorative Mother And Child Floor Lamp

    4天 前   回复

    Multimedia Led Projector For Home Theater
    Discount Price Soft Pvc Sheet - Standard dust proof 2mm flexible plastic door pvc strip curtain roll - Wanmao

    4天 前   回复

    Disposable Pod Device 650mah 4500 Puffs
    Coussin en caoutchouc de silicone pour presse à chaud

    Metal Gift Printing 访客IEWindows
    5天 前   回复

    Schmortopf aus rostfreiem Stahl
    Metal Gift Printing

    5天 前   回复

    Mopa Color Marking Machine for Stainless Steel
    Esterilizador calentador de biberones

    5天 前   回复

    Kase Magnetic Filter System
    Watercolor Paints Solid Color

    5 Gallon Cap Mold 访客IEWindows
    5天 前   回复

    New Fashion Design for China Sexy Girl Vibrating Silicone Adult Sex Products for Women
    5 Gallon Cap Mold

    5天 前   回复

    Household Water Filter Cartridges
    Three Way Ball Valve With ISO5211 Mounting Pad

    6天 前   回复

    Electric Explosion-proof Ball Valve
    Sottofondo in sughero per pavimenti in legno duro

    Remache ciego inoxidable 访客IEWindows
    6天 前   回复

    LED T8 Round Tube Housing
    Remache ciego inoxidable

    6天 前   回复

    Auto Air Condition Flap 2K Injection Mould
    portable container cabin manufacturer

    Geradwandige Tasse 访客IEWindows
    6天 前   回复

    Basic Model Die Boards Prolsil Stante Auto Bending Machine
    Geradwandige Tasse

    Mercedes Car Intercooler 访客IEWindows
    6天 前   回复

    Sonda de transmisión infrarroja de alta calidad para Cnc
    Mercedes Car Intercooler

    OE 1J0 145 803T 访客IEWindows
    6天 前   回复

    Corn bin
    OE 1J0 145 803T

    Sandalo da spiaggia uomo 访客IEWindows
    7天 前   回复

    Lucky Star Projector Night Light
    Sandalo da spiaggia uomo

    Handheld Fetal Doppler 访客IEWindows
    7天 前   回复

    SMD 2216 LED Strip
    Handheld Fetal Doppler

    Metal Reading Glasses 访客IEWindows
    7天 前   回复

    Study Reading Floor Lamp
    Metal Reading Glasses

    7天 前   回复

    Leather Wallet For Women
    UK Market TPD 600 Puffs Vape

    Mesh Sheet Metal Parts 访客IEWindows
    7天 前   回复

    11kv Transformer
    Mesh Sheet Metal Parts

    Gate Valve With Prices 访客IEWindows
    8天 前   回复

    Trunnion Ball Valve
    Gate Valve With Prices

    Butterfly Check Valve 访客IEWindows
    8天 前   回复

    precio de venta de componentes cnc de fundición de hierro fundido
    Butterfly Check Valve

    9天 前   回复

    YHXBCP000019
    removable bollards with chain

    9天 前   回复

    Fuel Water Separator Fs19599
    Bluetooth Barcode Scanner 1d 2d

    Capillary Transfer Tubes 访客IEWindows
    9天 前   回复

    ATSAML21J18B-MUT
    Capillary Transfer Tubes

    9天 前   回复

    Medical Class A
    Air Filters Trucks Auto Parts for Hino

    Aluminum Ball Valve 访客IEWindows
    9天 前   回复

    BTS7040-1EPA
    Aluminum Ball Valve

    9天 前   回复

    Wall Lamp
    Hydraulic Control Valve For Tractor Loader

    10天 前   回复

    Caterpillar Chain
    4.0 Inch Touch Screen Display

    Vanity Top Quartz 访客IEWindows
    10天 前   回复

    12363-62020
    Vanity Top Quartz

    Goldshell Hs1 Plus 访客IEWindows
    10天 前   回复

    50820-TBC-A02
    Goldshell Hs1 Plus

    E27 Holder Pendant Lamp 访客IEWindows
    10天 前   回复

    12360-0P080
    E27 Holder Pendant Lamp

    10天 前   回复

    Stainless Steel Pressure Cooker with Weight Valve
    Wholesale China Chain Link Fence Factory Quotes - Barbed Wire For Fencing System - Chongguan

    11天 前   回复

    Helium Star Balloons
    Glass Edge Polishing Machine

    11天 前   回复

    LED Linear Light System
    Aluminium Cream Whipper Cream Gun with Anti-Slip Silicon Grips

    11天 前   回复

    Circuit Board Making
    Multi Function 304 Stainless Steel Pressure Cooker

    Champagne Label 访客IEWindows
    11天 前   回复

    Assorted Pastel Balloons
    Champagne Label

    Love Foil Balloon 访客IEWindows
    11天 前   回复

    Attractive Air Purifier
    Love Foil Balloon

    Fiberglass Angle Bar 访客IEWindows
    11天 前   回复

    Comprehensive Water Treatment
    Fiberglass Angle Bar

    Smart Lock 访客IEWindows
    12天 前   回复

    Flat Die Boards Auto Bender Machine
    Smart Lock

    12天 前   回复

    Led Light Ice Cubes
    Affordable Fabric Sofas And Couches

    12天 前   回复

    16V Ultra capacitor
    The Latest Steel Rule Auto Bender Machine