| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- const _sfc_main = {
- data() {
- return {
- key: "bio",
- text: "",
- placeholder: "请输入内容",
- title: ""
- };
- },
- onLoad(options) {
- this.key = options.key || "bio";
- const value = options.value || "";
- this.text = value ? decodeURIComponent(value) : "";
- this.placeholder = options.placeholder ? decodeURIComponent(options.placeholder) : "请输入内容";
- this.title = options.title ? decodeURIComponent(options.title) : "编辑文本";
- },
- methods: {
- cancel() {
- common_vendor.index.navigateBack();
- },
- save() {
- const trimmedText = this.text.trim();
- common_vendor.index.setStorageSync(`temp_text_${this.key}`, trimmedText);
- common_vendor.index.showToast({
- title: "已保存",
- icon: "success",
- duration: 1e3
- });
- setTimeout(() => {
- common_vendor.index.navigateBack();
- }, 500);
- }
- }
- };
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return common_vendor.e({
- a: $data.title
- }, $data.title ? {
- b: common_vendor.t($data.title)
- } : {}, {
- c: $data.placeholder,
- d: $data.text,
- e: common_vendor.o(($event) => $data.text = $event.detail.value),
- f: common_vendor.o((...args) => $options.cancel && $options.cancel(...args)),
- g: common_vendor.o((...args) => $options.save && $options.save(...args))
- });
- }
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-58cb064e"]]);
- wx.createPage(MiniProgramPage);
- //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/text-edit/text-edit.js.map
|