chore(omi-cli): update base template
This commit is contained in:
parent
8ab0509cf5
commit
cf2f173336
|
@ -14,6 +14,7 @@
|
|||
"@babel/preset-env": "^7.2.3",
|
||||
"@babel/preset-react": "^7.0.0",
|
||||
"@babel/runtime": "^7.3.1",
|
||||
"@omiu/button": "latest",
|
||||
"autoprefixer": "7.1.6",
|
||||
"babel-core": "^7.0.0-bridge.0",
|
||||
"babel-eslint": "7.2.3",
|
||||
|
@ -45,7 +46,6 @@
|
|||
"omi": "latest",
|
||||
"omi-router": "latest",
|
||||
"omio": "latest",
|
||||
"omiu": "latest",
|
||||
"optimize-css-assets-webpack-plugin": "^5.0.1",
|
||||
"postcss-flexbugs-fixes": "3.2.0",
|
||||
"postcss-loader": "2.0.8",
|
||||
|
@ -137,7 +137,5 @@
|
|||
"tabWidth": 2,
|
||||
"useTabs": false
|
||||
},
|
||||
"alias": {
|
||||
"omi": "omio"
|
||||
}
|
||||
"alias": {}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ define('app-intro', class extends WeElement {
|
|||
<p class="app-intro">
|
||||
To get started, edit <code>src/elements/*/*.*</code> and save to reload.
|
||||
</p>
|
||||
<a href="https://tencent.github.io/omi/">omijs.org</a>
|
||||
</>
|
||||
}
|
||||
})
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
.app-omil {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.weui-btn:after {
|
||||
content: " ";
|
||||
width: 200%;
|
||||
height: 200%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
-webkit-transform: scale(0.5);
|
||||
transform: scale(0.5);
|
||||
-webkit-transform-origin: 0 0;
|
||||
transform-origin: 0 0;
|
||||
box-sizing: border-box;
|
||||
border-radius: 10px;
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
import { WeElement, define, h } from "omi";
|
||||
|
||||
// Recommend install omi-snippets plugins in VSC
|
||||
// Omi-snippets: https://marketplace.visualstudio.com/items?itemName=Wscats.omi-snippets
|
||||
import style from "./_index.css";
|
||||
|
||||
const appOmil = class extends WeElement {
|
||||
render() {
|
||||
return h(
|
||||
"div",
|
||||
{
|
||||
class: "app-omil"
|
||||
},
|
||||
h(
|
||||
"button",
|
||||
{
|
||||
onClick: this.omiSnippets.bind(this),
|
||||
class: "weui-btn weui-btn_primary",
|
||||
style: "width: 200px;"
|
||||
},
|
||||
this.data.title
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
static css =
|
||||
`
|
||||
.weui-btn {
|
||||
position: relative;
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding-left: 14px;
|
||||
padding-right: 14px;
|
||||
box-sizing: border-box;
|
||||
font-size: 18px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
color: #FFFFFF;
|
||||
line-height: 2.55555556;
|
||||
border-radius: 3px;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
overflow: hidden;
|
||||
border-width: 0;
|
||||
width: 100%;
|
||||
border-width: 0;
|
||||
outline: 0;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
` +
|
||||
style +
|
||||
`
|
||||
button{
|
||||
background-color: #58bc58;
|
||||
cursor: pointer;
|
||||
}
|
||||
`;
|
||||
install() {
|
||||
this.data = {
|
||||
title: "Install Omi Snippets!"
|
||||
};
|
||||
}
|
||||
omiSnippets() {
|
||||
window.open(
|
||||
"https://marketplace.visualstudio.com/items?itemName=Wscats.omi-snippets"
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
define("app-omil", appOmil);
|
|
@ -1,50 +0,0 @@
|
|||
<template name="app-omil">
|
||||
<div class="app-omil">
|
||||
<button onClick={this.omiSnippets.bind(this)} class="weui-btn weui-btn_primary" style="width: 200px;">{this.data.title}</button>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
// Recommend install omi-snippets plugins in VSC
|
||||
// Omi-snippets: https://marketplace.visualstudio.com/items?itemName=Wscats.omi-snippets
|
||||
import style from './_index.css'
|
||||
export default class {
|
||||
static css = style + `
|
||||
button{
|
||||
background-color: #58bc58;
|
||||
cursor: pointer;
|
||||
}
|
||||
`
|
||||
install() {
|
||||
this.data = {
|
||||
title: 'Install Omi Snippets!'
|
||||
}
|
||||
}
|
||||
omiSnippets() {
|
||||
window.open('https://marketplace.visualstudio.com/items?itemName=Wscats.omi-snippets')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.weui-btn {
|
||||
position: relative;
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding-left: 14px;
|
||||
padding-right: 14px;
|
||||
box-sizing: border-box;
|
||||
font-size: 18px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
color: #FFFFFF;
|
||||
line-height: 2.55555556;
|
||||
border-radius: 3px;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
overflow: hidden;
|
||||
border-width: 0;
|
||||
width: 100%;
|
||||
border-width: 0;
|
||||
outline: 0;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
</style>
|
|
@ -1,8 +1,7 @@
|
|||
import { define, WeElement } from 'omi'
|
||||
import logo from './logo.svg'
|
||||
import '../app-intro'
|
||||
import '../app-omil'
|
||||
import 'omiu/button'
|
||||
import '@omiu/button'
|
||||
|
||||
define('my-app', class extends WeElement {
|
||||
static css = require('./_index.less')
|
||||
|
@ -10,7 +9,7 @@ define('my-app', class extends WeElement {
|
|||
name = 'Omi'
|
||||
|
||||
clickHandler = () => {
|
||||
this.name = 'Omio'
|
||||
this.name = 'OMI'
|
||||
this.update()
|
||||
}
|
||||
|
||||
|
@ -27,8 +26,7 @@ define('my-app', class extends WeElement {
|
|||
<h1 class="app-title">Welcome to {this.name}</h1>
|
||||
</header>
|
||||
<app-intro />
|
||||
<o-button style='width:200px;'>I am omiu button.</o-button>
|
||||
<app-omil />
|
||||
<o-button>I am omiu button</o-button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue