snail.vue 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/snail.vue.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //@ sourceURL=/snail.vue.js
2
- import { mustFunction, isStringNotEmpty, isObject, script, delay, getMessage, style, hook, mustObject, defer, newId, isFunction } from 'snail.core';
2
+ import { mustFunction, isStringNotEmpty, isObject, script, delay, getMessage, style, hook, mustObject, defer, newId, isFunction, throwError } from 'snail.core';
3
3
  import { defineComponent, createBlock, openBlock, Transition, withCtx, createElementBlock, createCommentVNode, normalizeClass, renderSlot, normalizeProps, guardReactiveProps, ref, shallowRef, watch, onErrorCaptured, onActivated, onDeactivated, Fragment, resolveDynamicComponent, mergeProps, createSlots, renderList, createTextVNode, createElementVNode, toDisplayString, TransitionGroup, withModifiers, normalizeStyle, createVNode, createApp } from 'vue';
4
4
 
5
5
  const appCreatedFns = [];
@@ -262,8 +262,13 @@ const initVueApp = (() => {
262
262
 
263
263
  function mount(options, onDestroyed) {
264
264
  mustObject(options, "options");
265
- mustObject(options.target, "options.target");
266
- const app = createApp(_sfc_main$1, options.props);
265
+ options.target instanceof HTMLElement || throwError("options.target must be a HTMLElement");
266
+ const app = createApp(_sfc_main$1, {
267
+ name: options.name,
268
+ compponent: options.component,
269
+ url: options.url,
270
+ ...(options.props || {})
271
+ });
267
272
  app.mount(options.target);
268
273
  function destroy() {
269
274
  app.unmount();
@@ -261,8 +261,13 @@
261
261
 
262
262
  function mount(options, onDestroyed) {
263
263
  snail_core.mustObject(options, "options");
264
- snail_core.mustObject(options.target, "options.target");
265
- const app = vue.createApp(_sfc_main$1, options.props);
264
+ options.target instanceof HTMLElement || snail_core.throwError("options.target must be a HTMLElement");
265
+ const app = vue.createApp(_sfc_main$1, {
266
+ name: options.name,
267
+ compponent: options.component,
268
+ url: options.url,
269
+ ...(options.props || {})
270
+ });
266
271
  app.mount(options.target);
267
272
  function destroy() {
268
273
  app.unmount();
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "依赖【snail】,基于vue封装常用UI组件",
4
4
  "author": "snail_dev@163.com",
5
5
  "license": "MIT",
6
- "version": "1.0.13",
6
+ "version": "1.0.14",
7
7
  "type": "module",
8
8
  "main": "dist/snail.vue.js",
9
9
  "module": "dist/snail.vue.js",