File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import plate from "../src/modules/plate/index" ;
2+
3+ const Template = ( args : any ) => ( {
4+ components : { plate } ,
5+ setup ( ) {
6+ return {
7+ val : args . val
8+ } ;
9+ } ,
10+ template : `<div><plate :number=val v-slot="{ info, isValid }">
11+ <div>
12+ <h3>plate info:</h3>
13+ <p>type: <b>{{ info.type }}</b></p>
14+ <p>template: <b>{{ info.template }}</b></p>
15+ <p>details: <b>{{ info.details }}</b></p>
16+ <p>province: <b>{{ info.province }}</b></p>
17+ <p>category: <b>{{ info.category }}</b></p>
18+ </div>
19+ <br />
20+ <span>is plate valid: <b>{{ isValid }}</b></span>
21+ </plate></div>`
22+ } ) ;
23+
24+ export const Default = Template . bind ( { } ) ;
25+ Default . args = { val : "12D45147" } ;
26+
27+ export default {
28+ title : "Modules/plate" ,
29+ component : plate ,
30+ argTypes : {
31+ val : {
32+ name : "number" ,
33+ type : { name : "string" , required : true } ,
34+ defaultValue : null ,
35+ description : "plate number" ,
36+ table : {
37+ type : { summary : "string" } ,
38+ defaultValue : { summary : "null" }
39+ } ,
40+ control : {
41+ type : "text"
42+ }
43+ }
44+ }
45+ } ;
Original file line number Diff line number Diff line change 1+ import timeAgo from "../src/modules/timeAgo/index" ;
2+
3+ const Template = ( args : any ) => ( {
4+ components : { timeAgo } ,
5+ setup ( ) {
6+ return {
7+ val : args . val
8+ } ;
9+ } ,
10+ template : `<div><timeAgo :date=val v-slot="{ time }">{{ time }}</timeAgo></div>`
11+ } ) ;
12+
13+ export const Default = Template . bind ( { } ) ;
14+ Default . args = { val : "1400/04/07 18:00:00" } ;
15+
16+ export default {
17+ title : "Modules/timeAgo" ,
18+ component : timeAgo ,
19+ argTypes : {
20+ val : {
21+ name : "date" ,
22+ type : { name : "string" , required : true } ,
23+ defaultValue : null ,
24+ description : "a date string in yyyy/mm/dd hh:mm:ss format" ,
25+ table : {
26+ type : { summary : "string" } ,
27+ defaultValue : { summary : "null" }
28+ } ,
29+ control : {
30+ type : "text"
31+ }
32+ }
33+ }
34+ } ;
You can’t perform that action at this time.
0 commit comments