omim - update readme

This commit is contained in:
dntzhang 2019-06-18 10:04:02 +08:00
parent f809f46dda
commit 8b69d80814
9 changed files with 289 additions and 8 deletions

View File

@ -132,7 +132,7 @@ export default function SomeComponent(props) {
return (
<div>
<p>The switch is {result ? 'on' : 'off'}</p>
<m-icon-button icons="['favorite', 'favorite_border']" onEventChange={e => setSwitch(e.detail.isOn)}>
<m-icon-button color="red" icons="['favorite', 'favorite_border']" onEventChange={e => setSwitch(e.detail.isOn)}>
</m-icon-button>
</div>
)
@ -149,24 +149,32 @@ Many thanks to calebdwilliams's [jsx-native-events](https://github.com/calebdwil
import '@omim/core/icon-button'
export default {
name: "HelloWorld",
name: 'HelloWorld',
data: function() {
return {
return {
result: false
}
},
methods: {
myEvent: function(evt) {
myEvent: function(evt) {
this.result = evt.detail.isOn
}
}
}
</script>
<div class="component">
<p>The switch is {{result? 'on' : 'off'}}</p>
<m-icon-button icon="['favorite', 'favorite_border']" @change="myEvent"></m-icon-button>
</div>
<template>
<div class="component">
<p>The switch is {{result? 'on' : 'off'}}</p>
<m-icon-button color="red" icons="['favorite', 'favorite_border']" @change="myEvent"></m-icon-button>
</div>
</template>
```
> Note that in order to display icon in react or vue app, you need to put this in HTML:
```html
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
```
## Contribution

View File

@ -0,0 +1,26 @@
<script>
import '@omim/core/icon-button'
export default {
name: 'HelloWorld',
data: function() {
return {
result: false
}
},
methods: {
myEvent: function(evt) {
this.result = evt.detail.isOn
}
}
}
</script>
<template>
<div class="component">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<p>The switch is {{result? 'on' : 'off'}}</p>
<m-icon-button color="red" icons="['favorite', 'favorite_border']" @change="myEvent"></m-icon-button>
</div>
</template>

View File

@ -0,0 +1 @@
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><title>Vue CLI App</title><link href=js/app.8259b763.js rel=preload as=script><link href=js/chunk-vendors.3a0605dc.js rel=preload as=script></head><body><div id=app></div><script src=js/chunk-vendors.3a0605dc.js></script><script src=js/app.8259b763.js></script></body></html>

View File

@ -0,0 +1,2 @@
(function(e){function t(t){for(var r,i,l=t[0],a=t[1],s=t[2],f=0,p=[];f<l.length;f++)i=l[f],o[i]&&p.push(o[i][0]),o[i]=0;for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r]);c&&c(t);while(p.length)p.shift()();return u.push.apply(u,s||[]),n()}function n(){for(var e,t=0;t<u.length;t++){for(var n=u[t],r=!0,l=1;l<n.length;l++){var a=n[l];0!==o[a]&&(r=!1)}r&&(u.splice(t--,1),e=i(i.s=n[0]))}return e}var r={},o={app:0},u=[];function i(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var l=window["webpackJsonp"]=window["webpackJsonp"]||[],a=l.push.bind(l);l.push=t,l=l.slice();for(var s=0;s<l.length;s++)t(l[s]);var c=a;u.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("bfb2")},e76a:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"component"},[n("link",{attrs:{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons"}}),n("p",[e._v("The switch is "+e._s(e.result?"on":"off"))]),n("m-icon-button",{attrs:{color:"red",icons:"['favorite', 'favorite_border']"},on:{change:e.myEvent}})],1)},o=[],u=(n("8713"),{name:"HelloWorld",data:function(){return{result:!1}},methods:{myEvent:function(e){this.result=e.detail.isOn}}}),i=u,l=n("307b"),a=Object(l["a"])(i,r,o,!1,null,null,null);t["a"]=a.exports}});
//# sourceMappingURL=app.8259b763.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,16 @@
{
"name": "test-vue",
"version": "1.0.0",
"description": "",
"main": "",
"dependencies": {
"@omim/core": "^0.8.1"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "MIT"
}

View File

@ -0,0 +1,3 @@
module.exports = {
publicPath: './'
}