vant 3.3.3-beta.nuxt3 → 3.3.3

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/lib/vant.es.js CHANGED
@@ -14101,6 +14101,7 @@ var _Uploader = defineComponent({
14101
14101
  slots
14102
14102
  } = _ref;
14103
14103
  var inputRef = ref();
14104
+ var urls = [];
14104
14105
  var getDetail = function(index2) {
14105
14106
  if (index2 === void 0) {
14106
14107
  index2 = props.modelValue.length;
@@ -14207,7 +14208,13 @@ var _Uploader = defineComponent({
14207
14208
  var previewImage = (item) => {
14208
14209
  if (props.previewFullImage) {
14209
14210
  var imageFiles = props.modelValue.filter(isImageFile);
14210
- var images = imageFiles.map((item2) => item2.content || item2.url).filter(Boolean);
14211
+ var images = imageFiles.map((item2) => {
14212
+ if (item2.file && !item2.url) {
14213
+ item2.url = URL.createObjectURL(item2.file);
14214
+ urls.push(item2.url);
14215
+ }
14216
+ return item2.url;
14217
+ }).filter(Boolean);
14211
14218
  imagePreview = ImagePreview(extend({
14212
14219
  images,
14213
14220
  startPosition: imageFiles.indexOf(item),
@@ -14283,6 +14290,9 @@ var _Uploader = defineComponent({
14283
14290
  inputRef.value.click();
14284
14291
  }
14285
14292
  };
14293
+ onBeforeUnmount(() => {
14294
+ urls.forEach((url) => URL.revokeObjectURL(url));
14295
+ });
14286
14296
  useExpose({
14287
14297
  chooseFile,
14288
14298
  closeImagePreview
@@ -14298,7 +14308,7 @@ var _Uploader = defineComponent({
14298
14308
  }
14299
14309
  });
14300
14310
  var Uploader = withInstall(_Uploader);
14301
- var version = "3.3.2";
14311
+ var version = "3.3.3";
14302
14312
  function install(app) {
14303
14313
  var components = [ActionBar, ActionBarButton, ActionBarIcon, ActionSheet, AddressEdit, AddressList, Area, Badge, Button, Calendar, Card, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Circle, Col, Collapse, CollapseItem, ConfigProvider, ContactCard, ContactEdit, ContactList, CountDown, Coupon, CouponCell, CouponList, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, Form, Grid, GridItem, Icon, Image$1, ImagePreview, IndexAnchor, IndexBar, List, Loading, Locale, NavBar, NoticeBar, Notify, NumberKeyboard, Overlay, Pagination, PasswordInput, Picker, Popover, Popup, Progress, PullRefresh, Radio, RadioGroup, Rate, Row, Search, ShareSheet, Sidebar, SidebarItem, Skeleton, Slider, Step, Stepper, Steps, Sticky, SubmitBar, Swipe, SwipeCell, SwipeItem, Switch, Tab, Tabbar, TabbarItem, Tabs, Tag, Toast, TreeSelect, Uploader];
14304
14314
  components.forEach((item) => {
@@ -14101,6 +14101,7 @@ var _Uploader = defineComponent({
14101
14101
  slots
14102
14102
  } = _ref;
14103
14103
  var inputRef = ref();
14104
+ var urls = [];
14104
14105
  var getDetail = function(index2) {
14105
14106
  if (index2 === void 0) {
14106
14107
  index2 = props.modelValue.length;
@@ -14207,7 +14208,13 @@ var _Uploader = defineComponent({
14207
14208
  var previewImage = (item) => {
14208
14209
  if (props.previewFullImage) {
14209
14210
  var imageFiles = props.modelValue.filter(isImageFile);
14210
- var images = imageFiles.map((item2) => item2.content || item2.url).filter(Boolean);
14211
+ var images = imageFiles.map((item2) => {
14212
+ if (item2.file && !item2.url) {
14213
+ item2.url = URL.createObjectURL(item2.file);
14214
+ urls.push(item2.url);
14215
+ }
14216
+ return item2.url;
14217
+ }).filter(Boolean);
14211
14218
  imagePreview = ImagePreview(extend({
14212
14219
  images,
14213
14220
  startPosition: imageFiles.indexOf(item),
@@ -14283,6 +14290,9 @@ var _Uploader = defineComponent({
14283
14290
  inputRef.value.click();
14284
14291
  }
14285
14292
  };
14293
+ onBeforeUnmount(() => {
14294
+ urls.forEach((url) => URL.revokeObjectURL(url));
14295
+ });
14286
14296
  useExpose({
14287
14297
  chooseFile,
14288
14298
  closeImagePreview
@@ -14298,7 +14308,7 @@ var _Uploader = defineComponent({
14298
14308
  }
14299
14309
  });
14300
14310
  var Uploader = withInstall(_Uploader);
14301
- var version = "3.3.2";
14311
+ var version = "3.3.3";
14302
14312
  function install(app) {
14303
14313
  var components = [ActionBar, ActionBarButton, ActionBarIcon, ActionSheet, AddressEdit, AddressList, Area, Badge, Button, Calendar, Card, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Circle, Col, Collapse, CollapseItem, ConfigProvider, ContactCard, ContactEdit, ContactList, CountDown, Coupon, CouponCell, CouponList, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, Form, Grid, GridItem, Icon, Image$1, ImagePreview, IndexAnchor, IndexBar, List, Loading, Locale, NavBar, NoticeBar, Notify, NumberKeyboard, Overlay, Pagination, PasswordInput, Picker, Popover, Popup, Progress, PullRefresh, Radio, RadioGroup, Rate, Row, Search, ShareSheet, Sidebar, SidebarItem, Skeleton, Slider, Step, Stepper, Steps, Sticky, SubmitBar, Swipe, SwipeCell, SwipeItem, Switch, Tab, Tabbar, TabbarItem, Tabs, Tag, Toast, TreeSelect, Uploader];
14304
14314
  components.forEach((item) => {
package/lib/vant.js CHANGED
@@ -15185,6 +15185,7 @@
15185
15185
  slots
15186
15186
  } = _ref;
15187
15187
  var inputRef = vue.ref();
15188
+ var urls = [];
15188
15189
  var getDetail = function(index2) {
15189
15190
  if (index2 === void 0) {
15190
15191
  index2 = props.modelValue.length;
@@ -15291,7 +15292,13 @@
15291
15292
  var previewImage = (item) => {
15292
15293
  if (props.previewFullImage) {
15293
15294
  var imageFiles = props.modelValue.filter(isImageFile);
15294
- var images = imageFiles.map((item2) => item2.content || item2.url).filter(Boolean);
15295
+ var images = imageFiles.map((item2) => {
15296
+ if (item2.file && !item2.url) {
15297
+ item2.url = URL.createObjectURL(item2.file);
15298
+ urls.push(item2.url);
15299
+ }
15300
+ return item2.url;
15301
+ }).filter(Boolean);
15295
15302
  imagePreview = ImagePreview(extend({
15296
15303
  images,
15297
15304
  startPosition: imageFiles.indexOf(item),
@@ -15367,6 +15374,9 @@
15367
15374
  inputRef.value.click();
15368
15375
  }
15369
15376
  };
15377
+ vue.onBeforeUnmount(() => {
15378
+ urls.forEach((url) => URL.revokeObjectURL(url));
15379
+ });
15370
15380
  useExpose({
15371
15381
  chooseFile,
15372
15382
  closeImagePreview
@@ -15382,7 +15392,7 @@
15382
15392
  }
15383
15393
  });
15384
15394
  var Uploader = withInstall(_Uploader);
15385
- var version = "3.3.2";
15395
+ var version = "3.3.3";
15386
15396
  function install(app) {
15387
15397
  var components = [ActionBar, ActionBarButton, ActionBarIcon, ActionSheet, AddressEdit, AddressList, Area, Badge, Button, Calendar, Card, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Circle, Col, Collapse, CollapseItem, ConfigProvider, ContactCard, ContactEdit, ContactList, CountDown, Coupon, CouponCell, CouponList, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, Form, Grid, GridItem, Icon, Image$1, ImagePreview, IndexAnchor, IndexBar, List, Loading, Locale, NavBar, NoticeBar, Notify, NumberKeyboard, Overlay, Pagination, PasswordInput, Picker, Popover, Popup, Progress, PullRefresh, Radio, RadioGroup, Rate, Row, Search, ShareSheet, Sidebar, SidebarItem, Skeleton, Slider, Step, Stepper, Steps, Sticky, SubmitBar, Swipe, SwipeCell, SwipeItem, Switch, Tab, Tabbar, TabbarItem, Tabs, Tag, Toast, TreeSelect, Uploader];
15388
15398
  components.forEach((item) => {