我正在尝试通过 VueJS 中的 scrollBehaviour 进行滚动以锚定。
通常,我使用以下方式更改当前路由器:
this.$router.push({path : 'componentName', name: 'componentName', hash: "#" + this.jumpToSearchField})
Run Code Online (Sandbox Code Playgroud)
我的 VueRouter 定义为:
const router = new VueRouter({
routes: routes,
base: '/base/',
mode: 'history',
scrollBehavior: function(to, from, savedPosition) {
let position = {}
if (to.hash) {
position = {
selector : to.hash
};
} else {
position = {x : 0 , y : 0}
}
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(position)
}, 10)
})
}
});
Run Code Online (Sandbox Code Playgroud)
我的路线:
[
{
path: …
Run Code Online (Sandbox Code Playgroud) 我也在迁移到新版本的 RN 和 firebase。我按照firebase v6 迁移指南中的规定做了所有事情,但是现在,xcode 显示错误'RNFirebaseNotifications.h' file not found和RNFirebaseMessaging.h file not found。由于 RN > 0.60 使用自动链接,这可能是 xcode 找不到所需模块的原因吗?如果你知道如何解决这个问题,请告诉我。我的 package.json
"dependencies": {
"@react-native-community/async-storage": "^1.7.1",
"@react-native-community/netinfo": "^5.0.1",
"@react-native-firebase/app": "^6.2.0",
"@react-native-firebase/messaging": "^6.2.0",
"@tinkoff/utils": "^1.0.2",
"buffer": "^5.2.1",
"connected-react-navigation": "^0.0.4",
"formik": "^1.5.2",
"jetifier": "^1.6.4",
"moment": "^2.22.2",
"react": "16.9.0",
"react-dom": "^16.8.6",
"react-native": "0.61.5",
}
Run Code Online (Sandbox Code Playgroud)
不幸的是,我在 firebase github 页面上没有找到任何解决方案:(
我将bootstrap v4用于VueJS,并且需要增加b-modal。我尝试了这里提到的不同方法:https : //github.com/bootstrap-vue/bootstrap-vue/issues/632,但没有任何帮助。一般来说,我的代码如下所示:
<b-modal :ref="fieldName" :id="fieldName" :title="msg" size="lg" modal-class="b-modal">
<div class="script_table_container" v-if="scripts.length > 0">
<b-table :items="scripts" per-page="10" :current-page="currentPage">
<template slot="propertySnippet" slot-scope="data">
<samp>
{{data.value}}
</samp>
</template>
</b-table>
<b-pagination :total-rows="scripts.length" per-page="10" v-model="currentPage" hide-goto-end-buttons align="right"/>
</div>
<div slot="modal-footer">
<b-btn class="mr-sm-2 su-btn-link" @click="close">Close</b-btn>
</div>
</b-modal>
Run Code Online (Sandbox Code Playgroud)
我需要将宽度增加到屏幕的80-90%,因为表内的某些值很长。
希望对您有所帮助。我相信你是大师。
PS已找到答案。要将更改应用于某些b模态,可以执行下一步:
我在全球创建:
@media (min-width: 992px) {
.modal .modal-huge {
max-width: 90% !important;
width: 90% !important;;
}
}
Run Code Online (Sandbox Code Playgroud)
之后,我将“巨大”放入b模态的大小道具中。使用“巨大”是因为该类以“巨大”单词结尾。
vue.js ×2
bootstrap-4 ×1
css ×1
firebase ×1
html ×1
ios ×1
javascript ×1
react-native ×1
vue-router ×1