我正在为 firebase 自定义声明而苦苦挣扎。
我已经测试了很多方法都不起作用。显然,我错过了概念本身的一些重要内容。
所以我回到了根源。来自 google 示例的此脚本应该对新创建的用户应用海关规则
exports.processSignUp = functions.auth.user().onCreate(event => {
const user = event.data; // The Firebase user.
const customClaims = {
param: true,
accessLevel: 9
};
// Set custom user claims on this newly created user.
return admin.auth().setCustomUserClaims(user.uid, customClaims)
});
Run Code Online (Sandbox Code Playgroud)
然后在客户端上,我检查结果
firebase.auth().currentUser.getIdTokenResult()
.then((idTokenResult) => {
// Confirm the user is an Admin.
console.log(idTokenResult.claims)
if (!!idTokenResult.claims.param) {
// Show admin UI.
console.log("param")
} else {
// Show regular user UI.
console.log("no param")
}
})
.catch((error) => {
console.log(error); …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用此处的Codepen示例实现过渡,但使用了Vuetify。
我注意到在v-flex组件破坏v-flex订单之前添加过渡标签。在此示例codeandbox中,有两条路线,一条具有过渡,另一条没有过渡。
组件具有以下结构:
<v-container>
<v-layout row wrap pb-2 pt-2>
<!-- is transition group -->
<transition-group name="cards" >
<v-flex xs3
v-for="card in items"
:key="card"
>
<v-layout>
<v-card>
.....
</v-card>
</v-layout>
</v-flex>
</transition-group>
</v-layout>
</v-container>
Run Code Online (Sandbox Code Playgroud) 我已将导航添加到抽屉,除链接与页面相同的情况外,其他所有功能均正常。单击链接后,抽屉保持打开状态,对于访问者来说,该页面是当前页面并不明显。
我试图做这样的事情,@click.stop="(this.router.path != '/' ?
this.router.push('/') : drawer = !drawer)"Vue不会产生任何错误,并且代码无法正常工作。
我哪里错了?