This repository was archived by the owner on Jun 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +39
-18
lines changed Expand file tree Collapse file tree 7 files changed +39
-18
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ import {
5454 maxLength ,
5555 url ,
5656 /* } from '../dist/as-dynamic-forms.common'; */
57- } from ' ../src/main ' ;
57+ } from ' ../../ src/index ' ;
5858
5959const data = () => ({
6060 formData: {},
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import Vue from 'vue';
22import App from './App.vue' ;
33import './styles/main.scss' ;
44
5- import VueDynamicForms from '../../src/main ' ; // Dev
5+ import VueDynamicForms from '../../src/index ' ; // Dev
66// import VueDynamicForms from '@asigloo/vue-dynamic-forms' // Prod
77
88Vue . config . productionTip = false ;
Original file line number Diff line number Diff line change 66$input-border-radius: 50px; */
77// @import '../../src/styles/themes/default.scss';
88
9- @import ' ../../src/styles/themes/material.scss' ;
9+ @import ' ../../../ src/styles/themes/material.scss' ;
Original file line number Diff line number Diff line change 1313 },
1414 "scripts" : {
1515 "serve" : " vue-cli-service serve" ,
16- "build" : " vue-cli-service build --target lib --name as-dynamic-forms src/main .js" ,
16+ "build" : " vue-cli-service build --target lib --name as-dynamic-forms src/index .js" ,
1717 "lint" : " vue-cli-service lint" ,
1818 "test" : " vue-cli-service test:unit --verbose --no-cache --watchAll" ,
1919 "publish" : " npm run build && npm publish --access public" ,
Original file line number Diff line number Diff line change 1+ import DynamicForm from './components/dynamic-form/DynamicForm.vue' ;
2+ import DynamicInput from './components/dynamic-input/DynamicInput.vue' ;
3+ export * from './core/utils' ;
4+ const version = process . env . VERSION || require ( '../package.json' ) . version ;
5+
6+ export let _Vue ;
7+
8+ export function install ( Vue ) {
9+ if ( install . installed && _Vue === Vue ) return ;
10+ install . installed = true ;
11+
12+ _Vue = Vue ;
13+
14+ Vue . component ( 'dynamic-form' , DynamicForm ) ;
15+ Vue . component ( 'dynamic-input' , DynamicInput ) ;
16+ }
17+
18+ export const AsDynamicForms = {
19+ install,
20+ version,
21+ } ;
22+
23+ // Automatic installation if Vue has been added to the global scope.
24+ if ( typeof window !== 'undefined' && window . Vue ) {
25+ window . Vue . use ( AsDynamicForms ) ;
26+ }
27+
28+ export { DynamicForm , DynamicInput } ;
29+
30+ export default AsDynamicForms ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ module.exports = {
1717 filename : 'index.html' ,
1818 } ,
1919 } ,
20+ configureWebpack : {
21+ output : {
22+ libraryExport : 'default' ,
23+ } ,
24+ } ,
2025 chainWebpack : config => {
2126 config . optimization . splitChunks ( false ) ;
2227 config . merge ( { devtool : 'source-map' } ) ;
You can’t perform that action at this time.
0 commit comments