-
-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
2,303 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules/ | ||
node-debug.log | ||
TODO.md | ||
yarn-error.log | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# PortalVue | ||
|
||
> A Portal Component for Vuejs, to render DOM outside of a component, anywhere in the document. | ||
<p style="tex-align: center"> | ||
<img src="http://portal-vue.github.io" alt="PortalVue Logo"> | ||
</p> | ||
|
||
|
||
For more detailed documentation and additional Information, please visit <a href="http://portal-vue.github.io">the docs</a> | ||
|
||
## Installation | ||
|
||
``` | ||
npm install -g portal-vue | ||
// in .js | ||
import PortalVue from 'portal-vue' | ||
Vue.use(PortalVue) | ||
``` | ||
|
||
|
||
|
||
## Usage | ||
|
||
```html | ||
<portal to="destination"> | ||
<p>This slot content will be rendered wherever the <portal-target> with name 'destination' | ||
is located.</p> | ||
</portal> | ||
|
||
<portal-target name="destination"> | ||
<!-- | ||
This component can be located anwhere in your App. | ||
The slot content of the above portal component will be rendered here. | ||
--> | ||
</portal-target> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import babel from 'rollup-plugin-babel' | ||
import vue from 'rollup-plugin-vue' | ||
import commonjs from 'rollup-plugin-commonjs' | ||
import nodeResolve from 'rollup-plugin-node-resolve' | ||
|
||
const babelConfig = { | ||
// runtimeHelpers: true, | ||
exclude: 'node_modules/**', | ||
} | ||
|
||
const nodeResolveOptions = { | ||
module: true, jsnext: true, | ||
extensions: ['.js', '.vue'], | ||
} | ||
|
||
export default { | ||
entry: './src/index.js', | ||
external: ['vue'], | ||
globals: { | ||
vue: 'Vue', | ||
}, | ||
format: 'umd', | ||
moduleName: 'PortalVue', | ||
dest: './dist/portal-vue.js', // equivalent to --output | ||
sourceMap: true, | ||
plugins: [ | ||
nodeResolve(nodeResolveOptions), | ||
vue({ compileTemplate: false }), | ||
commonjs(), | ||
babel(babelConfig), | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
var path = require('path') | ||
var webpack = require('webpack') | ||
var FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin') | ||
|
||
const config = { | ||
entry: { | ||
example: path.resolve(__dirname, '../example/index.js'), | ||
vendor: ['vue'], | ||
}, | ||
output: { | ||
path: path.resolve(__dirname, '../example'), | ||
publicPath: '/', | ||
library: 'VuePortal', | ||
libraryTarget: 'umd', | ||
filename: '[name].build.js', | ||
}, | ||
resolve: { | ||
extensions: ['.js', '.json', '.vue'], | ||
alias: { | ||
'vue$': 'vue/dist/vue.common', | ||
}, | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(js|vue)$/, | ||
loader: 'eslint-loader', | ||
enforce: 'pre', | ||
exclude: /node_modules/, | ||
options: { | ||
formatter: require('eslint-friendly-formatter'), | ||
}, | ||
}, | ||
{ | ||
test: /\.js$/, | ||
loader: 'babel-loader', | ||
exclude: path.resolve(__dirname, '../node_modules'), | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: [ | ||
'style-loader', | ||
{ | ||
loader: 'css-loader', | ||
}, | ||
], | ||
}, | ||
{ | ||
test: /\.vue$/, | ||
loader: 'vue-loader', | ||
exclude: /node_modules/, | ||
}, | ||
], | ||
}, | ||
plugins: [ | ||
new FriendlyErrorsWebpackPlugin(), | ||
new webpack.HotModuleReplacementPlugin(), | ||
new webpack.DefinePlugin({ | ||
'process.env': { | ||
NODE_ENV: process.env.NODE_ENV ? JSON.stringify(process.env.NODE_ENV) : "'development'", | ||
}, | ||
}), | ||
], | ||
devtool: 'source-map', | ||
performance: { | ||
hints: false, | ||
}, | ||
devServer: { | ||
contentBase: 'example/', | ||
inline: true, | ||
hot: true, | ||
quiet: true, | ||
stats: { | ||
colors: true, | ||
chunks: false, | ||
}, | ||
}, | ||
} | ||
|
||
module.exports = config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var merge = require('webpack-merge') | ||
|
||
var devConfig = require('./webpack.conf.js') | ||
|
||
var config = merge(devConfig, { | ||
devtool: '#inline-source-map', | ||
}) | ||
|
||
module.exports = config |
Oops, something went wrong.