mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-16 11:44:01 +08:00
Initial commit
This commit is contained in:
31
packages/row/cooking.conf.js
Normal file
31
packages/row/cooking.conf.js
Normal file
@@ -0,0 +1,31 @@
|
||||
var cooking = require('cooking');
|
||||
var path = require('path');
|
||||
|
||||
cooking.set({
|
||||
entry: {
|
||||
index: path.join(__dirname, 'index.js')
|
||||
},
|
||||
dist: path.join(__dirname, 'lib'),
|
||||
template: false,
|
||||
format: 'umd',
|
||||
moduleName: 'ElRow',
|
||||
extractCSS: 'style.css',
|
||||
|
||||
extends: ['vue', 'saladcss']
|
||||
});
|
||||
|
||||
cooking.add('resolve.alias', {
|
||||
'main': path.join(__dirname, '../../src'),
|
||||
'packages': path.join(__dirname, '../../packages')
|
||||
});
|
||||
|
||||
cooking.add('externals', {
|
||||
vue: {
|
||||
root: 'Vue',
|
||||
commonjs: 'vue',
|
||||
commonjs2: 'vue',
|
||||
amd: 'vue'
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = cooking.resolve();
|
||||
8
packages/row/index.js
Normal file
8
packages/row/index.js
Normal file
@@ -0,0 +1,8 @@
|
||||
const ElRow = require('./src/row');
|
||||
|
||||
ElRow.install = function(Vue) {
|
||||
Vue.component('el-row', ElRow);
|
||||
};
|
||||
|
||||
module.exports = ElRow;
|
||||
|
||||
15
packages/row/package.json
Normal file
15
packages/row/package.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "el-row",
|
||||
"version": "1.0.2",
|
||||
"description": "A row component for Vue.",
|
||||
"keywords": [
|
||||
"element",
|
||||
"vue",
|
||||
"component"
|
||||
],
|
||||
"main": "./lib/index.js",
|
||||
"repository": "https://github.com/element-component/element/tree/master/packages/row",
|
||||
"author": "qingwei-li<qingwei.li@ele.me>",
|
||||
"license": "MIT",
|
||||
"dependencies": {}
|
||||
}
|
||||
34
packages/row/src/row.vue
Normal file
34
packages/row/src/row.vue
Normal file
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div class="el-row" v-bind:style="style">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'ElRow',
|
||||
|
||||
props: {
|
||||
gutter: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
style() {
|
||||
var ret = {};
|
||||
|
||||
if (this.gutter) {
|
||||
ret.marginLeft = `-${this.gutter / 2}px`;
|
||||
ret.marginRight = ret.marginLeft;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user