How does vue router output data values?

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
<div id="app">
  <h1>Hello App!</h1>
  

<router-link to="/foo">Go to Foo</router-link> <router-link to="/bar?a=b">Go to Bar</router-link>

<router-view></router-view> </div> <script id="foo" type="text/template"> <h1>Hello, {{bigfoot}}</h1> </script> <script id="bar" type="text/template"> <h1>Hello2, {{nani}}</h1> </script> <script src="https://cdn.bootcss.com/vue/2.5.17-beta.0/vue.min.js"></script> <script src="https://cdn.bootcss.com/vue-router/3.0.1/vue-router.min.js"></script> <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script> <script> var Foo = { template: $("-sharpfoo").html() }; var Bar = { template: $("-sharpbar").html() }; var routes = [ { path: "/foo", component: Foo }, { path: "/bar", component: Bar } ]; var router = new VueRouter({ routes:routes }); new Vue({ el: "-sharpapp", data: { bigfoot: "", nani: "" }, router: router }); </script> </body> </html>

error bigfoot or nani undefined will be reported above

Feb.27,2021

your data is defined in the root component and needs to be defined in the subcomponent


to write: https://codepen.io/anon/pen/M.

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bddce8-313ac.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bddce8-313ac.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?