Skip to content

Commit 1b8731a

Browse files
committed
fix: typeof String #1382
1 parent f616464 commit 1b8731a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core/directives/action.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const action = Vue.directive('action', {
1919
const actionName = binding.arg
2020
const roles = store.getters.roles
2121
const elVal = vnode.context.$route.meta.permission
22-
const permissionId = elVal instanceof String && [elVal] || elVal
22+
const permissionId = Object.prototype.toString.call(elVal) === '[object String]' && [elVal] || elVal
2323
roles.permissions.forEach(p => {
2424
if (!permissionId.includes(p.permissionId)) {
2525
return

0 commit comments

Comments
 (0)