1.定义基础组件和路由.
// 1. 定义路由组件.
// 也可以从其他文件导入
const Home = {
template: `
<q-text data-data='{"data":{},"options":""}'></q-text>
<input type="text" />
<iframe src="https://www.antdv.com/docs/vue/introduce-cn/" height="500" width="900">`,
};
const About = { template: `<div>About</div><input type="text" />` };
// 2. 定义一些路由
// 每个路由都需要映射到一个组件。
const routes = [
{
path: "/",
component: Home,
meta: {
keepAlive: true, // 需要被缓存
isIframe: true,
component: Home,
},
},
{
path: "/about",
component: About,
meta: {
keepAlive: true, // 需要被缓存
},
},
{
path: "/iframe",
compon