Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
npm
/
glsx-components
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1a5496c8
authored
Dec 16, 2021
by
limin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1.2.6
1 parent
54a7d113
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
package.json
src/App.vue
src/packages/Button/src/index.js
package.json
View file @
1a5496c
{
{
"name"
:
"glsx-components"
,
"name"
:
"glsx-components"
,
"description"
:
"glsx vue components"
,
"description"
:
"glsx vue components"
,
"version"
:
"1.2.
4
"
,
"version"
:
"1.2.
6
"
,
"author"
:
"limin <17653212@qq.com>"
,
"author"
:
"limin <17653212@qq.com>"
,
"license"
:
"MIT"
,
"license"
:
"MIT"
,
"main"
:
"dist/glsx-components.common.js"
,
"main"
:
"dist/glsx-components.common.js"
,
...
...
src/App.vue
View file @
1a5496c
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<!--
<img
alt=
"Vue logo"
src=
"./assets/logo.png"
/>
-->
<!--
<img
alt=
"Vue logo"
src=
"./assets/logo.png"
/>
-->
<!--
<HelloWorld
msg=
"Welcome to Your Vue.js App"
/>
<!--
<HelloWorld
msg=
"Welcome to Your Vue.js App"
/>
<GLExternal
url=
"//localhost:8080/html/employee/index.html"
:subscribe=
"subscribe"
></GLExternal>
-->
<GLExternal
url=
"//localhost:8080/html/employee/index.html"
:subscribe=
"subscribe"
></GLExternal>
-->
<GLButton
@
click=
"click"
fn=
"1-1-1-1
"
mode=
"el-button
"
>
232321321
</GLButton>
<GLButton
@
click=
"click"
fn=
"1-1-1-1
1"
mode=
"el-button"
display=
"disabled
"
>
232321321
</GLButton>
<el-button
type=
"primary"
>
aaa
</el-button>
<el-button
type=
"primary"
>
aaa
</el-button>
<el-button
type=
"primary"
size=
"small"
>
aaa
</el-button>
<el-button
type=
"primary"
size=
"small"
>
aaa
</el-button>
<el-button
type=
"primary"
size=
"mini"
>
aaa
</el-button>
<el-button
type=
"primary"
size=
"mini"
>
aaa
</el-button>
...
...
src/packages/Button/src/index.js
View file @
1a5496c
const
TYPE
=
Object
.
freeze
({
const
DISPLAY
=
Object
.
freeze
({
none
:
''
NONE
:
''
,
DISABLED
:
'disabled'
})
})
// 权限校验
// 权限校验
function
permission
(
ctx
)
{
function
permission
(
ctx
)
{
if
(
!
ctx
)
return
TYPE
.
none
const
{
const
{
props
:
{
fn
,
mode
},
props
:
{
fn
,
mode
,
display
},
parent
:
{
parent
:
{
$GLBUTTION_PERMISSIONS
:
{
routes
=
[],
routerBase
}
$GLBUTTION_PERMISSIONS
:
{
routes
=
[],
routerBase
}
}
}
...
@@ -14,8 +14,11 @@ function permission(ctx) {
...
@@ -14,8 +14,11 @@ function permission(ctx) {
const
router
=
routes
.
find
(
route
=>
location
.
pathname
===
`
${
routerBase
}${
route
.
path
.
split
(
':/'
)[
0
]}
`
)
const
router
=
routes
.
find
(
route
=>
location
.
pathname
===
`
${
routerBase
}${
route
.
path
.
split
(
':/'
)[
0
]}
`
)
if
(
router
&&
router
.
meta
&&
router
.
meta
.
permissions
&&
router
.
meta
.
permissions
.
includes
(
fn
))
{
if
(
router
&&
router
.
meta
&&
router
.
meta
.
permissions
&&
router
.
meta
.
permissions
.
includes
(
fn
))
{
return
mode
return
mode
}
else
if
(
display
===
DISPLAY
.
DISABLED
)
{
ctx
.
data
.
attrs
.
disabled
=
true
return
mode
}
}
return
TYPE
.
none
return
DISPLAY
.
NONE
}
}
export
default
{
export
default
{
...
@@ -28,6 +31,10 @@ export default {
...
@@ -28,6 +31,10 @@ export default {
mode
:
{
mode
:
{
type
:
String
,
type
:
String
,
default
:
'el-button'
default
:
'el-button'
},
display
:
{
type
:
String
,
default
:
''
}
}
},
},
render
:
function
(
createElement
,
context
)
{
render
:
function
(
createElement
,
context
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment