diff --git a/src/components/Iframe/index.vue b/src/components/Iframe/index.vue
new file mode 100644
index 0000000..9f395a3
--- /dev/null
+++ b/src/components/Iframe/index.vue
@@ -0,0 +1,30 @@
+
+
+
+
+
+
diff --git a/src/components/Permission/index.js b/src/components/Permission/index.js
new file mode 100644
index 0000000..e5dadd3
--- /dev/null
+++ b/src/components/Permission/index.js
@@ -0,0 +1,13 @@
+import permission from './permission'
+
+const install = function(Vue) {
+ Vue.directive('permission', permission)
+}
+
+if (window.Vue) {
+ window['permission'] = permission
+ Vue.use(install); // eslint-disable-line
+}
+
+permission.install = install
+export default permission
diff --git a/src/components/Permission/permission.js b/src/components/Permission/permission.js
new file mode 100644
index 0000000..e731ebf
--- /dev/null
+++ b/src/components/Permission/permission.js
@@ -0,0 +1,21 @@
+import store from '@/store'
+
+export default {
+ inserted(el, binding, vnode) {
+ const { value } = binding
+ const roles = store.getters && store.getters.roles
+ if (value && value instanceof Array && value.length > 0) {
+ const permissionRoles = value
+
+ const hasPermission = roles.some(role => {
+ return permissionRoles.includes(role)
+ })
+
+ if (!hasPermission) {
+ el.parentNode && el.parentNode.removeChild(el)
+ }
+ } else {
+ throw new Error(`使用方式: v-permission="['admin','editor']"`)
+ }
+ }
+}