小编D V*_*esh的帖子

TypeError: this.$route.push is not a function vue.js and Uncaught TypeError: Cannot read property 'push' of undefined

我收到类似“TypeError: this.$route.push is not a function”这样的错误,即使我也尝试过 ES6 来绑定它,但仍然无法正常工作。每当我点击 about.vue 中的“获取主页数据”按钮时,它应该重定向到主页。正在工作,但在这里我需要调用 ajax 并且在 ajax 响应之后只有它必须重定向,,所以我不使用

路由器.js

import Vue from "vue";
import Router from "vue-router";
import Home from "../components/Home/Home.vue";
import About from "../components/About.vue";
import FallBackPage from "../components/FallBackPage/FallBackPage.vue";
import MyOrders from "../components/MyOrders/MyOrders.vue";

 Vue.use(Router);

export function createRouter() {
  return new Router({
  mode: "history",
  routes: [
   { path: "/", component: Home },
   { path: "/about", component: About },
   { path: "/myorders", component: MyOrders },
   { path: "/*", component: FallBackPage }
  ]
 });
}
Run Code Online (Sandbox Code Playgroud)

主文件

 import …
Run Code Online (Sandbox Code Playgroud)

vue.js vue-router vuex vuejs2

6
推荐指数
2
解决办法
2万
查看次数

Flutter Row() 'crossAxisAlignment != CrossAxisAlignment.baseline || textBaseline != null': 不是真的。失败的断言:

在颤振中,我在使用时出错 crossAxisAlignment: CrossAxisAlignment.baseline

错误::

Failed assertion: line 3791 pos 15: 'crossAxisAlignment != CrossAxisAlignment.baseline || textBaseline != null': is not true.
Run Code Online (Sandbox Code Playgroud)

代码::

 Row(
    crossAxisAlignment: CrossAxisAlignment.baseline,

    children: <Widget>[
        Text(
            '192',
            style: kBoldNumberText,
        ),
        Text(
        'cm',
        style: kLabelText,
        )
    ],
    )
Run Code Online (Sandbox Code Playgroud)

dart flutter

4
推荐指数
1
解决办法
2439
查看次数

Find the sum of each row as well as that of each column in 2 dimensional matrix ( m X n)

How to find the sum of each row as well as that of each column in 2 dimensional matrix ( m X n).

[
  [1, 2, 3],
  [3, 2, 1]
]
Run Code Online (Sandbox Code Playgroud)

I know in one dimensional array, we can do:

var sum = [5, 6, 3].reduce(add, 0);

function add(a, b) {
  return a + b;
}

console.log(sum);
Run Code Online (Sandbox Code Playgroud)

javascript arrays

0
推荐指数
1
解决办法
1775
查看次数

当父 div 的宽度为 80vw 时,如何设置设备宽度为 100vw 的子 Div

.parent {
  width: 80vw;
  height: 200px;
  background-color: red;
  margin: 0 auto;
  text-align: center;
}

.child {
  width: 100vw;
  height: 100px;
  background-color: blue;
}
Run Code Online (Sandbox Code Playgroud)
<div class="parent">
  <div class="child"></div>
</div>
Run Code Online (Sandbox Code Playgroud)

div当父母的div宽度较小时,如何将孩子居中对齐child?如何设置儿童div100vw设备宽度的父母时,div宽度为80vw

css twitter-bootstrap

0
推荐指数
1
解决办法
1744
查看次数