我收到类似“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) 在颤振中,我在使用时出错 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) 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) .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?如何设置儿童div与100vw设备宽度的父母时,div宽度为80vw?