Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
京东前端
nutui
提交
d7deea00
N
nutui
项目概览
京东前端
/
nutui
通知
37
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
nutui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d7deea00
编写于
3月 30, 2021
作者:
richard_1015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: demo getCurrentInstance build error
上级
304204ee
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
30 addition
and
30 deletion
+30
-30
src/packages/inputnumber/demo.vue
src/packages/inputnumber/demo.vue
+4
-4
src/packages/rate/demo.vue
src/packages/rate/demo.vue
+2
-2
src/packages/shortpassword/demo.vue
src/packages/shortpassword/demo.vue
+6
-6
src/packages/shortpassword/doc.md
src/packages/shortpassword/doc.md
+4
-4
src/packages/switch/demo.vue
src/packages/switch/demo.vue
+3
-3
src/packages/switch/doc.md
src/packages/switch/doc.md
+4
-4
src/packages/toast/demo.vue
src/packages/toast/demo.vue
+7
-7
未找到文件。
src/packages/inputnumber/demo.vue
浏览文件 @
d7deea00
...
...
@@ -52,7 +52,7 @@ const { createDemo } = createComponent('inputnumber');
export
default
createDemo
({
props
:
{},
setup
()
{
let
{
ctx
}
=
getCurrentInstance
();
let
{
proxy
}
=
getCurrentInstance
();
const
state
=
reactive
({
val1
:
1
,
...
...
@@ -67,15 +67,15 @@ export default createDemo({
});
const
onChange
=
(
value
:
number
)
=>
{
ctx
.
$toast
.
loading
(
'
异步演示 2 秒后更改
'
);
proxy
.
$toast
.
loading
(
'
异步演示 2 秒后更改
'
);
setTimeout
(()
=>
{
state
.
val8
=
value
;
ctx
.
$toast
.
hide
();
proxy
.
$toast
.
hide
();
},
2000
);
};
const
overlimit
=
()
=>
{
ctx
.
$toast
.
warn
(
'
超出限制事件触发
'
);
proxy
.
$toast
.
warn
(
'
超出限制事件触发
'
);
};
return
{
...
...
src/packages/rate/demo.vue
浏览文件 @
d7deea00
...
...
@@ -38,7 +38,7 @@ import { createComponent } from '@/utils/create';
const
{
createDemo
}
=
createComponent
(
'
rate
'
);
export
default
createDemo
({
setup
()
{
let
{
ctx
}
=
getCurrentInstance
();
let
{
proxy
}
=
getCurrentInstance
();
const
state
=
reactive
({
val
:
3
,
...
...
@@ -52,7 +52,7 @@ export default createDemo({
val8
:
3
});
const
onChange
=
val
=>
{
ctx
.
$toast
.
text
(
state
.
result
);
proxy
.
$toast
.
text
(
state
.
result
);
};
return
{
state
,
...
...
src/packages/shortpassword/demo.vue
浏览文件 @
d7deea00
...
...
@@ -73,7 +73,7 @@ import { createComponent } from '@/utils/create';
const
{
createDemo
}
=
createComponent
(
'
shortpassword
'
);
export
default
createDemo
({
setup
()
{
let
{
ctx
}
=
getCurrentInstance
()
as
any
;
let
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
state
=
reactive
({
visible
:
false
,
...
...
@@ -84,21 +84,21 @@ export default createDemo({
});
const
methods
=
{
onChange
(
val
:
string
)
{
val
&&
ctx
.
$toast
.
text
(
val
);
val
&&
proxy
.
$toast
.
text
(
val
);
},
onOk
(
val
:
string
)
{
val
&&
ctx
.
$toast
.
text
(
val
);
val
&&
proxy
.
$toast
.
text
(
val
);
state
.
visible
=
false
;
},
onComplete
()
{},
onTips
()
{
ctx
.
$toast
.
text
(
'
执行忘记密码逻辑
'
);
proxy
.
$toast
.
text
(
'
执行忘记密码逻辑
'
);
},
close
()
{
ctx
.
$toast
.
text
(
'
点击icon关闭弹窗
'
);
proxy
.
$toast
.
text
(
'
点击icon关闭弹窗
'
);
},
cancel
()
{
ctx
.
$toast
.
text
(
'
点击取消按钮关闭弹窗
'
);
proxy
.
$toast
.
text
(
'
点击取消按钮关闭弹窗
'
);
}
};
...
...
src/packages/shortpassword/doc.md
浏览文件 @
d7deea00
...
...
@@ -35,7 +35,7 @@ app.use(ShortPassword);
```
javascript
import
{
reactive
,
getCurrentInstance
}
from
'
vue
'
;
setup
()
{
let
{
ctx
}
=
getCurrentInstance
();
let
{
proxy
}
=
getCurrentInstance
();
const
state
=
reactive
({
visible
:
false
,
noButton
:
true
,
...
...
@@ -45,17 +45,17 @@ setup() {
});
const
methods
=
{
onChange
(
val
:
string
)
{
val
&&
ctx
.
$toast
.
text
(
val
);
val
&&
proxy
.
$toast
.
text
(
val
);
},
onOk
(
val
:
string
)
{
val
&&
ctx
.
$toast
.
text
(
val
);
val
&&
proxy
.
$toast
.
text
(
val
);
state
.
visible
=
false
;
},
onComplete
()
{
},
onTips
()
{
ctx
.
$toast
.
text
(
'
执行忘记密码逻辑
'
);
proxy
.
$toast
.
text
(
'
执行忘记密码逻辑
'
);
}
};
return
{
...
...
src/packages/switch/demo.vue
浏览文件 @
d7deea00
...
...
@@ -47,15 +47,15 @@ import { createComponent } from '@/utils/create';
const
{
createDemo
}
=
createComponent
(
'
switch
'
);
export
default
createDemo
({
setup
()
{
let
{
ctx
}
=
getCurrentInstance
()
as
any
;
let
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
checked
=
ref
(
true
);
const
checkedAsync
=
ref
(
true
);
const
change
=
(
value
:
boolean
,
event
:
Event
)
=>
{
ctx
.
$toast
.
text
(
`触发了change事件,开关状态:
${
value
}
`
);
proxy
.
$toast
.
text
(
`触发了change事件,开关状态:
${
value
}
`
);
};
const
changeAsync
=
(
value
:
boolean
,
event
:
Event
)
=>
{
ctx
.
$toast
.
text
(
`2秒后异步触发
${
value
}
`
);
proxy
.
$toast
.
text
(
`2秒后异步触发
${
value
}
`
);
setTimeout
(()
=>
{
checkedAsync
.
value
=
value
;
},
2000
);
...
...
src/packages/switch/doc.md
浏览文件 @
d7deea00
...
...
@@ -46,10 +46,10 @@ export default {
import
{
ref
,
getCurrentInstance
}
from
'
vue
'
;
export
default
{
setup
()
{
let
{
ctx
}
=
getCurrentInstance
()
as
any
;
let
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
checked
=
ref
(
true
);
const
change
=
(
value
:
boolean
,
event
:
Event
)
=>
{
ctx
.
$toast
.
text
(
`触发了change事件,开关状态:
${
value
}
`
);
proxy
.
$toast
.
text
(
`触发了change事件,开关状态:
${
value
}
`
);
};
return
{
checked
,
...
...
@@ -68,10 +68,10 @@ export default {
import
{
ref
,
getCurrentInstance
}
from
'
vue
'
;
export
default
{
setup
()
{
let
{
ctx
}
=
getCurrentInstance
()
as
any
;
let
{
proxy
}
=
getCurrentInstance
()
as
any
;
const
checkedAsync
=
ref
(
true
);
const
changeAsync
=
(
value
:
boolean
,
event
:
Event
)
=>
{
ctx
.
$toast
.
text
(
`2秒后异步触发
${
value
}
`
);
proxy
.
$toast
.
text
(
`2秒后异步触发
${
value
}
`
);
setTimeout
(()
=>
{
checkedAsync
.
value
=
value
;
},
2000
);
...
...
src/packages/toast/demo.vue
浏览文件 @
d7deea00
...
...
@@ -39,24 +39,24 @@ const { createDemo } = createComponent('toast');
export
default
createDemo
({
setup
()
{
const
{
ctx
}
=
getCurrentInstance
();
const
{
proxy
}
=
getCurrentInstance
();
const
textToast
=
msg
=>
{
ctx
.
$toast
.
text
(
msg
,
{
duration
:
100000
});
proxy
.
$toast
.
text
(
msg
,
{
duration
:
100000
});
};
const
successToast
=
msg
=>
{
ctx
.
$toast
.
success
(
msg
,
{
duration
:
100000
});
proxy
.
$toast
.
success
(
msg
,
{
duration
:
100000
});
};
const
errorToast
=
msg
=>
{
ctx
.
$toast
.
fail
(
msg
);
proxy
.
$toast
.
fail
(
msg
);
};
const
warningToast
=
msg
=>
{
ctx
.
$toast
.
warn
(
msg
);
proxy
.
$toast
.
warn
(
msg
);
};
const
loadingToast
=
msg
=>
{
ctx
.
$toast
.
loading
(
msg
,
{
duration
:
0
,
id
:
'
test
'
});
proxy
.
$toast
.
loading
(
msg
,
{
duration
:
0
,
id
:
'
test
'
});
setTimeout
(()
=>
{
ctx
.
$toast
.
success
(
'
加载完成
'
,
{
id
:
'
test
'
,
duration
:
2000
});
proxy
.
$toast
.
success
(
'
加载完成
'
,
{
id
:
'
test
'
,
duration
:
2000
});
},
2000
);
};
return
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录