author设置为test
\n样例代码
\n\n<sample :author=\"author\"></sample>\n
\n参数 | \n说明 | \n类型 | \n默认值 | \n可选值 | \n
---|---|---|---|---|
className | \n自定义额外类名 | \nstring | \n'' | \n'' | \n
样例代码
\n\n<div class=\"page-switch\">\n <span class=\"page-switch-text\">Switch state: {{switchStateText}}</span>\n <o2-switch class=\"page-switch-sample\" :checked=\"switchState\" :onChange=\"updateState\"></o2-switch>\n <o2-switch class=\"page-switch-sample\" :checked=\"false\" :disabled=\"true\"></o2-switch>\n</div>\n
\nexport default {\n data() {\n return {\n switchState: false\n };\n },\n computed: {\n switchStateText() {\n return this.switchState ? 'on' : 'off';\n }\n },\n methods: {\n updateState(newState) {\n console.log('changing');\n this.switchState = newState;\n }\n }\n};\n
\n参数 | \n说明 | \n类型 | \n默认值 | \n可选值 | \n
---|---|---|---|---|
checked | \n开关状态 | \nboolean | \nfalse | \ntrue,false | \n
loading | \nloading状态 | \nboolean | \nfalse | \ntrue,false | \n
disabled | \n禁用状态 | \nboolean | \nfalse | \ntrue,false | \n
onChange | \n回调 | \nfunction | \nfunction(){} | \n- | \n