feat: init
This commit is contained in:
150
dist/pages/index/index.js
vendored
Normal file
150
dist/pages/index/index.js
vendored
Normal file
@@ -0,0 +1,150 @@
|
||||
"use strict";
|
||||
(wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["pages/index/index"],{
|
||||
|
||||
/***/ "./node_modules/.pnpm/@tarojs+taro-loader@4.0.8_webpack@5.91.0_@swc+core@1.3.96_/node_modules/@tarojs/taro-loader/lib/entry-cache.js?name=pages/index/index!./src/pages/index/index.jsx":
|
||||
/*!**********************************************************************************************************************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/@tarojs+taro-loader@4.0.8_webpack@5.91.0_@swc+core@1.3.96_/node_modules/@tarojs/taro-loader/lib/entry-cache.js?name=pages/index/index!./src/pages/index/index.jsx ***!
|
||||
\**********************************************************************************************************************************************************************************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-redux */ "webpack/container/remote/react-redux");
|
||||
/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_1__);
|
||||
/* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/.pnpm/@tarojs+plugin-platform-weapp@4.0.8_@tarojs+service@4.0.8_@tarojs+shared@4.0.8/node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
|
||||
/* harmony import */ var _actions_counter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../actions/counter */ "./src/actions/counter.js");
|
||||
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
|
||||
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
|
||||
var _dec, _class;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
let Index = (_dec = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.connect)(_ref => {
|
||||
let {
|
||||
counter
|
||||
} = _ref;
|
||||
return {
|
||||
counter
|
||||
};
|
||||
}, dispatch => ({
|
||||
add() {
|
||||
dispatch((0,_actions_counter__WEBPACK_IMPORTED_MODULE_3__.add)());
|
||||
},
|
||||
dec() {
|
||||
dispatch((0,_actions_counter__WEBPACK_IMPORTED_MODULE_3__.minus)());
|
||||
},
|
||||
asyncAdd() {
|
||||
dispatch((0,_actions_counter__WEBPACK_IMPORTED_MODULE_3__.asyncAdd)());
|
||||
}
|
||||
})), _dec(_class = class Index extends react__WEBPACK_IMPORTED_MODULE_0__.Component {
|
||||
componentWillReceiveProps(nextProps) {
|
||||
console.log(this.props, nextProps);
|
||||
}
|
||||
componentWillUnmount() {}
|
||||
componentDidShow() {}
|
||||
componentDidHide() {}
|
||||
render() {
|
||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.View, {
|
||||
className: "index",
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.Button, {
|
||||
className: "add_btn",
|
||||
onClick: this.props.add,
|
||||
children: "+"
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.Button, {
|
||||
className: "dec_btn",
|
||||
onClick: this.props.dec,
|
||||
children: "-"
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.Button, {
|
||||
className: "dec_btn",
|
||||
onClick: this.props.asyncAdd,
|
||||
children: "async"
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.View, {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.Text, {
|
||||
children: this.props.counter.num
|
||||
})
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.View, {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_4__.Text, {
|
||||
children: "Hello, World"
|
||||
})
|
||||
})]
|
||||
});
|
||||
}
|
||||
}) || _class);
|
||||
/* harmony default export */ __webpack_exports__["default"] = (Index);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/actions/counter.js":
|
||||
/*!********************************!*\
|
||||
!*** ./src/actions/counter.js ***!
|
||||
\********************************/
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ add: function() { return /* binding */ add; },
|
||||
/* harmony export */ asyncAdd: function() { return /* binding */ asyncAdd; },
|
||||
/* harmony export */ minus: function() { return /* binding */ minus; }
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var _constants_counter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/counter */ "./src/constants/counter.js");
|
||||
|
||||
const add = () => {
|
||||
return {
|
||||
type: _constants_counter__WEBPACK_IMPORTED_MODULE_0__.ADD
|
||||
};
|
||||
};
|
||||
const minus = () => {
|
||||
return {
|
||||
type: _constants_counter__WEBPACK_IMPORTED_MODULE_0__.MINUS
|
||||
};
|
||||
};
|
||||
|
||||
// 异步的action
|
||||
function asyncAdd() {
|
||||
return dispatch => {
|
||||
setTimeout(() => {
|
||||
dispatch(add());
|
||||
}, 2000);
|
||||
};
|
||||
}
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/pages/index/index.jsx":
|
||||
/*!***********************************!*\
|
||||
!*** ./src/pages/index/index.jsx ***!
|
||||
\***********************************/
|
||||
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
||||
|
||||
/* harmony import */ var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/runtime */ "webpack/container/remote/@tarojs/runtime");
|
||||
/* harmony import */ var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var _node_modules_pnpm_tarojs_taro_loader_4_0_8_webpack_5_91_0_swc_core_1_3_96_node_modules_tarojs_taro_loader_lib_entry_cache_js_name_pages_index_index_index_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/.pnpm/@tarojs+taro-loader@4.0.8_webpack@5.91.0_@swc+core@1.3.96_/node_modules/@tarojs/taro-loader/lib/entry-cache.js?name=pages/index/index!./index.jsx */ "./node_modules/.pnpm/@tarojs+taro-loader@4.0.8_webpack@5.91.0_@swc+core@1.3.96_/node_modules/@tarojs/taro-loader/lib/entry-cache.js?name=pages/index/index!./src/pages/index/index.jsx");
|
||||
|
||||
|
||||
var config = {"navigationBarTitleText":"首页"};
|
||||
|
||||
|
||||
|
||||
var taroOption = (0,_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__.createPageConfig)(_node_modules_pnpm_tarojs_taro_loader_4_0_8_webpack_5_91_0_swc_core_1_3_96_node_modules_tarojs_taro_loader_lib_entry_cache_js_name_pages_index_index_index_jsx__WEBPACK_IMPORTED_MODULE_1__["default"], 'pages/index/index', {root:{cn:[]}}, config || {})
|
||||
if (_node_modules_pnpm_tarojs_taro_loader_4_0_8_webpack_5_91_0_swc_core_1_3_96_node_modules_tarojs_taro_loader_lib_entry_cache_js_name_pages_index_index_index_jsx__WEBPACK_IMPORTED_MODULE_1__["default"] && _node_modules_pnpm_tarojs_taro_loader_4_0_8_webpack_5_91_0_swc_core_1_3_96_node_modules_tarojs_taro_loader_lib_entry_cache_js_name_pages_index_index_index_jsx__WEBPACK_IMPORTED_MODULE_1__["default"].behaviors) {
|
||||
taroOption.behaviors = (taroOption.behaviors || []).concat(_node_modules_pnpm_tarojs_taro_loader_4_0_8_webpack_5_91_0_swc_core_1_3_96_node_modules_tarojs_taro_loader_lib_entry_cache_js_name_pages_index_index_index_jsx__WEBPACK_IMPORTED_MODULE_1__["default"].behaviors)
|
||||
}
|
||||
var inst = Page(taroOption)
|
||||
|
||||
|
||||
|
||||
/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_pnpm_tarojs_taro_loader_4_0_8_webpack_5_91_0_swc_core_1_3_96_node_modules_tarojs_taro_loader_lib_entry_cache_js_name_pages_index_index_index_jsx__WEBPACK_IMPORTED_MODULE_1__["default"]);
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
},
|
||||
/******/ function(__webpack_require__) { // webpackRuntimeModules
|
||||
/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
|
||||
/******/ __webpack_require__.O(0, ["taro","common"], function() { return __webpack_exec__("./src/pages/index/index.jsx"); });
|
||||
/******/ var __webpack_exports__ = __webpack_require__.O();
|
||||
/******/ }
|
||||
]);
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
dist/pages/index/index.js.map
vendored
Normal file
1
dist/pages/index/index.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"pages/index/index.js","mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;AC1DA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["webpack://taro-template/._src_pages_index_index.jsx","webpack://taro-template/._src_actions_counter.js","webpack://taro-template/./src/pages/index/index.jsx?e561"],"sourcesContent":["var _dec, _class;\nimport { Component } from 'react';\nimport { connect } from 'react-redux';\nimport { View, Button, Text } from '@tarojs/components';\nimport { add, minus, asyncAdd } from '../../actions/counter';\nimport './index.scss';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nlet Index = (_dec = connect(_ref => {\n let {\n counter\n } = _ref;\n return {\n counter\n };\n}, dispatch => ({\n add() {\n dispatch(add());\n },\n dec() {\n dispatch(minus());\n },\n asyncAdd() {\n dispatch(asyncAdd());\n }\n})), _dec(_class = class Index extends Component {\n componentWillReceiveProps(nextProps) {\n console.log(this.props, nextProps);\n }\n componentWillUnmount() {}\n componentDidShow() {}\n componentDidHide() {}\n render() {\n return /*#__PURE__*/_jsxs(View, {\n className: \"index\",\n children: [/*#__PURE__*/_jsx(Button, {\n className: \"add_btn\",\n onClick: this.props.add,\n children: \"+\"\n }), /*#__PURE__*/_jsx(Button, {\n className: \"dec_btn\",\n onClick: this.props.dec,\n children: \"-\"\n }), /*#__PURE__*/_jsx(Button, {\n className: \"dec_btn\",\n onClick: this.props.asyncAdd,\n children: \"async\"\n }), /*#__PURE__*/_jsx(View, {\n children: /*#__PURE__*/_jsx(Text, {\n children: this.props.counter.num\n })\n }), /*#__PURE__*/_jsx(View, {\n children: /*#__PURE__*/_jsx(Text, {\n children: \"Hello, World\"\n })\n })]\n });\n }\n}) || _class);\nexport default Index;","import {\n ADD,\n MINUS\n} from '../constants/counter'\n\nexport const add = () => {\n return {\n type: ADD\n }\n}\nexport const minus = () => {\n return {\n type: MINUS\n }\n}\n\n// 异步的action\nexport function asyncAdd () {\n return dispatch => {\n setTimeout(() => {\n dispatch(add())\n }, 2000)\n }\n}\n","import { createPageConfig } from '@tarojs/runtime'\nimport component from \"!!../../../node_modules/.pnpm/@tarojs+taro-loader@4.0.8_webpack@5.91.0_@swc+core@1.3.96_/node_modules/@tarojs/taro-loader/lib/entry-cache.js?name=pages/index/index!./index.jsx\"\nvar config = {\"navigationBarTitleText\":\"首页\"};\n\n\n\nvar taroOption = createPageConfig(component, 'pages/index/index', {root:{cn:[]}}, config || {})\nif (component && component.behaviors) {\n taroOption.behaviors = (taroOption.behaviors || []).concat(component.behaviors)\n}\nvar inst = Page(taroOption)\n\n\n\nexport default component\n"],"names":[],"sourceRoot":""}
|
||||
1
dist/pages/index/index.json
vendored
Normal file
1
dist/pages/index/index.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"navigationBarTitleText":"首页","usingComponents":{"comp":"../../comp"}}
|
||||
2
dist/pages/index/index.wxml
vendored
Normal file
2
dist/pages/index/index.wxml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
<import src="../../base.wxml"/>
|
||||
<template is="taro_tmpl" data="{{root:root}}" />
|
||||
7
dist/pages/index/index.wxss
vendored
Normal file
7
dist/pages/index/index.wxss
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** css ./node_modules/.pnpm/css-loader@7.1.2_webpack@5.91.0_@swc+core@1.3.96_/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[1]!./node_modules/.pnpm/postcss-loader@8.1.1_postcss@8.4.49_typescript@5.7.2_webpack@5.91.0_@swc+core@1.3.96_/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[2]!./node_modules/.pnpm/resolve-url-loader@5.0.0/node_modules/resolve-url-loader/index.js!./node_modules/.pnpm/sass-loader@14.2.1_sass@1.83.0_webpack@5.91.0_@swc+core@1.3.96_/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[0].use[4]!./src/pages/index/index.scss ***!
|
||||
\**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
.index {
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
}
|
||||
Reference in New Issue
Block a user