Skip to content

Commit

Permalink
chore: optimize build
Browse files Browse the repository at this point in the history
  • Loading branch information
xrkffgg committed Dec 7, 2020
1 parent 462fb34 commit 75ca9a1
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 23 deletions.
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# zoo-layout

![](https://img.shields.io/npm/v/@zoo-js/layout?style=flat-square)

Layout for zoo-js.
## install

```
Expand All @@ -9,30 +12,28 @@ yarn add @zoo-js/layout
```

## use

```javascript
import { createApp } from 'vue'
import Layout from '@zoo-js/layout'
createApp().use(Layout)

//jsx

const slots = {
header: () => <div>header</div>,
default: () => <div>main</div>
header: () => <div>header</div>,
default: () => <div>main</div>
}

<Layout title={name: 'xx', url: 'xx'} vSlots={slots}></Layout>

//template

<template>
<Layout title={
name: 'xx',
url: 'xxx'
}>
<div slot="header">header</div>
<div>main</div>
</Layout>
<Layout title={
name: 'xx',
url: 'xxx'
}>
<div slot="header">header</div>
<div>main</div>
</Layout>
</template>

```
```
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
{
"name": "@zoo-js/layout",
"version": "0.0.1",
"main": "lib/zoo-layout.umd.min.js",
"main": "./dist/zoo-layout.umd.min.js",
"files": [
"dist"
],
"author": "zoo-js",
"description": "zoo-layout",
"keyword": [
"homepage": "https://github.com/zoo-js/zoo-layout",
"keywords": [
"zoo-js",
"layout"
],
"private": false,
"license": "MIT",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lib": "vue-cli-service build --target lib --name zoo-layout --dest lib packages/index.js"
"dist": "vue-cli-service build --target lib --name zoo-layout packages/index.js",
"prepublishOnly": "npm run dist && np --yolo --no-publish"
},
"repository": {
"type": "git",
Expand All @@ -30,6 +36,7 @@
"@vue/compiler-sfc": "^3.0.0",
"babel-eslint": "^10.1.0",
"compression-webpack-plugin": "^6.0.5",
"np": "^7.0.0",
"sass": "1.29.0",
"sass-loader": "10.1.0"
},
Expand Down
1 change: 0 additions & 1 deletion packages/Layout/Layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default defineComponent({
},

setup(props, { slots }) {
console.log(props.title)
const renderHeader = () => {
return <div class="zoo-layout-header">
<div class="zoo-layout-header-content">
Expand Down
16 changes: 10 additions & 6 deletions vue.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
module.exports = {
pages: {
index: {
entry: 'examples/main.js',
template: 'public/index.html',
filename: 'index.html'
}
pages: {
index: {
entry: 'examples/main.js',
template: 'public/index.html',
filename: 'index.html'
}
},
productionSourceMap: false,
css: {
extract: false
},
}

0 comments on commit 75ca9a1

Please sign in to comment.