feat: tailwindcss

This commit is contained in:
2024-12-18 17:49:02 +08:00
parent 54780c2b24
commit 80226cc657
28 changed files with 1398 additions and 59 deletions

6
.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="FLOW" />
</component>
</project>

View File

@@ -1,10 +1,11 @@
import { defineConfig } from '@tarojs/cli' import { UnifiedWebpackPluginV5 } from 'weapp-tailwindcss/webpack'
import {defineConfig} from '@tarojs/cli'
import devConfig from './dev' import devConfig from './dev'
import prodConfig from './prod' import prodConfig from './prod'
// https://taro-docs.jd.com/docs/next/config#defineconfig-辅助函数 // https://taro-docs.jd.com/docs/next/config#defineconfig-辅助函数
export default defineConfig(async (merge, { command, mode }) => { export default defineConfig(async (merge, {command, mode}) => {
const baseConfig = { const baseConfig = {
projectName: 'taro-template', projectName: 'taro-template',
date: '2024-12-18', date: '2024-12-18',
@@ -18,13 +19,10 @@ export default defineConfig(async (merge, { command, mode }) => {
sourceRoot: 'src', sourceRoot: 'src',
outputRoot: 'dist', outputRoot: 'dist',
plugins: [], plugins: [],
defineConstants: { defineConstants: {},
},
copy: { copy: {
patterns: [ patterns: [],
], options: {}
options: {
}
}, },
framework: 'react', framework: 'react',
compiler: 'webpack5', compiler: 'webpack5',
@@ -35,9 +33,7 @@ export default defineConfig(async (merge, { command, mode }) => {
postcss: { postcss: {
pxtransform: { pxtransform: {
enable: true, enable: true,
config: { config: {}
}
}, },
cssModules: { cssModules: {
enable: false, // 默认为 false如需使用 css modules 功能,则设为 true enable: false, // 默认为 false如需使用 css modules 功能,则设为 true
@@ -46,6 +42,20 @@ export default defineConfig(async (merge, { command, mode }) => {
generateScopedName: '[name]__[local]___[hash:base64:5]' generateScopedName: '[name]__[local]___[hash:base64:5]'
} }
} }
},
webpackChain(chain, webpack) {
chain.merge({
plugin: {
install: {
plugin: UnifiedWebpackPluginV5,
args: [{
appType: 'taro',
// 下面个配置,会开启 rem -> rpx 的转化
rem2rpx: true
}]
}
}
})
} }
}, },
h5: { h5: {

2
dist/app.js vendored
View File

@@ -89,7 +89,7 @@ class App extends react__WEBPACK_IMPORTED_MODULE_0__.Component {
var config = {"pages":["pages/index/index"],"window":{"backgroundTextStyle":"light","navigationBarBackgroundColor":"#fff","navigationBarTitleText":"WeChat","navigationBarTextStyle":"black"}}; var config = {"pages":["pages/home/index","pages/index/index"],"window":{"backgroundTextStyle":"light","navigationBarBackgroundColor":"#fff","navigationBarTitleText":"WeChat","navigationBarTextStyle":"black"},"lazyCodeLoading":"requiredComponents"};
_tarojs_runtime__WEBPACK_IMPORTED_MODULE_1__.window.__taroAppConfig = config _tarojs_runtime__WEBPACK_IMPORTED_MODULE_1__.window.__taroAppConfig = config
var inst = App((0,_tarojs_plugin_framework_react_dist_runtime__WEBPACK_IMPORTED_MODULE_2__.createReactApp)(_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_app_app_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], react__WEBPACK_IMPORTED_MODULE_5__, (react_dom__WEBPACK_IMPORTED_MODULE_6___default()), config)) var inst = App((0,_tarojs_plugin_framework_react_dist_runtime__WEBPACK_IMPORTED_MODULE_2__.createReactApp)(_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_app_app_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], react__WEBPACK_IMPORTED_MODULE_5__, (react_dom__WEBPACK_IMPORTED_MODULE_6___default()), config))

2
dist/app.js.map vendored
View File

@@ -1 +1 @@
{"version":3,"file":"app.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACrBA;AAEA;AACA;AACA;AAEA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACrBA;AACA;AAEA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;ACLA;AACA;AACA;AACA;AAEA;AAEA;AAAA;AAIA;AAIA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AACA;AACA","sources":["webpack://taro-template/._src_app.jsx","webpack://taro-template/./src/app.jsx?b80d","webpack://taro-template/._src_reducers_counter.js","webpack://taro-template/._src_reducers_index.js","webpack://taro-template/._src_store_index.js"],"sourcesContent":["import { Component } from 'react';\nimport { Provider } from 'react-redux';\nimport configStore from './store';\nimport './app.scss';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst store = configStore();\nclass App extends Component {\n componentDidMount() {}\n componentDidShow() {}\n componentDidHide() {}\n\n // 在 App 类中的 render() 函数没有实际作用\n // 请勿修改此函数\n render() {\n return /*#__PURE__*/_jsx(Provider, {\n store: store,\n children: this.props.children\n });\n }\n}\nexport default App;","import '@tarojs/plugin-platform-weapp/dist/runtime'\n\nimport { window } from '@tarojs/runtime'\nimport { createReactApp } from '@tarojs/plugin-framework-react/dist/runtime'\nimport { initPxTransform } from '@tarojs/taro'\n\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=app!./app.jsx\"\n\nimport * as React from 'react'\nimport ReactDOM from 'react-dom'\n\nvar config = {\"pages\":[\"pages/index/index\"],\"window\":{\"backgroundTextStyle\":\"light\",\"navigationBarBackgroundColor\":\"#fff\",\"navigationBarTitleText\":\"WeChat\",\"navigationBarTextStyle\":\"black\"}};\nwindow.__taroAppConfig = config\nvar inst = App(createReactApp(component, React, ReactDOM, config))\n\ninitPxTransform({\n designWidth: 750,\n deviceRatio: {\"375\":2,\"640\":1.17,\"750\":1,\"828\":0.905},\n baseFontSize: 20,\n unitPrecision: undefined,\n targetUnit: undefined\n})\n","import { ADD, MINUS } from '../constants/counter'\n\nconst INITIAL_STATE = {\n num: 0\n}\n\nexport default function counter (state = INITIAL_STATE, action) {\n switch (action.type) {\n case ADD:\n return {\n ...state,\n num: state.num + 1\n }\n case MINUS:\n return {\n ...state,\n num: state.num - 1\n }\n default:\n return state\n }\n}\n","import { combineReducers } from 'redux'\nimport counter from './counter'\n\nexport default combineReducers({\n counter\n})\n","import { legacy_createStore as createStore, applyMiddleware, compose } from 'redux'\nimport thunkMiddleware from 'redux-thunk'\nimport logger from 'redux-logger'\nimport rootReducer from '../reducers'\n\nconst composeEnhancers = typeof window === 'object' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\n ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({\n // Specify extensions options like name, actionsBlacklist, actionsCreators, serialize...\n })\n : compose\n\nconst middlewares = [\n thunkMiddleware\n]\n\nif (process.env.NODE_ENV === 'development') {\n middlewares.push(logger)\n}\n\nconst enhancer = composeEnhancers(\n applyMiddleware(...middlewares),\n // other store enhancers if any\n)\n\nexport default function configStore () {\n const store = createStore(rootReducer, enhancer)\n return store\n}\n"],"names":[],"sourceRoot":""} {"version":3,"file":"app.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACrBA;AAEA;AACA;AACA;AAEA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACrBA;AACA;AAEA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;ACLA;AACA;AACA;AACA;AAEA;AAEA;AAAA;AAIA;AAIA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AACA;AACA","sources":["webpack://taro-template/._src_app.jsx","webpack://taro-template/./src/app.jsx?b80d","webpack://taro-template/._src_reducers_counter.js","webpack://taro-template/._src_reducers_index.js","webpack://taro-template/._src_store_index.js"],"sourcesContent":["import { Component } from 'react';\nimport { Provider } from 'react-redux';\nimport configStore from './store';\nimport './app.scss';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst store = configStore();\nclass App extends Component {\n componentDidMount() {}\n componentDidShow() {}\n componentDidHide() {}\n\n // 在 App 类中的 render() 函数没有实际作用\n // 请勿修改此函数\n render() {\n return /*#__PURE__*/_jsx(Provider, {\n store: store,\n children: this.props.children\n });\n }\n}\nexport default App;","import '@tarojs/plugin-platform-weapp/dist/runtime'\n\nimport { window } from '@tarojs/runtime'\nimport { createReactApp } from '@tarojs/plugin-framework-react/dist/runtime'\nimport { initPxTransform } from '@tarojs/taro'\n\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=app!./app.jsx\"\n\nimport * as React from 'react'\nimport ReactDOM from 'react-dom'\n\nvar config = {\"pages\":[\"pages/home/index\",\"pages/index/index\"],\"window\":{\"backgroundTextStyle\":\"light\",\"navigationBarBackgroundColor\":\"#fff\",\"navigationBarTitleText\":\"WeChat\",\"navigationBarTextStyle\":\"black\"},\"lazyCodeLoading\":\"requiredComponents\"};\nwindow.__taroAppConfig = config\nvar inst = App(createReactApp(component, React, ReactDOM, config))\n\ninitPxTransform({\n designWidth: 750,\n deviceRatio: {\"375\":2,\"640\":1.17,\"750\":1,\"828\":0.905},\n baseFontSize: 20,\n unitPrecision: undefined,\n targetUnit: undefined\n})\n","import { ADD, MINUS } from '../constants/counter'\n\nconst INITIAL_STATE = {\n num: 0\n}\n\nexport default function counter (state = INITIAL_STATE, action) {\n switch (action.type) {\n case ADD:\n return {\n ...state,\n num: state.num + 1\n }\n case MINUS:\n return {\n ...state,\n num: state.num - 1\n }\n default:\n return state\n }\n}\n","import { combineReducers } from 'redux'\nimport counter from './counter'\n\nexport default combineReducers({\n counter\n})\n","import { legacy_createStore as createStore, applyMiddleware, compose } from 'redux'\nimport thunkMiddleware from 'redux-thunk'\nimport logger from 'redux-logger'\nimport rootReducer from '../reducers'\n\nconst composeEnhancers = typeof window === 'object' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\n ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({\n // Specify extensions options like name, actionsBlacklist, actionsCreators, serialize...\n })\n : compose\n\nconst middlewares = [\n thunkMiddleware\n]\n\nif (process.env.NODE_ENV === 'development') {\n middlewares.push(logger)\n}\n\nconst enhancer = composeEnhancers(\n applyMiddleware(...middlewares),\n // other store enhancers if any\n)\n\nexport default function configStore () {\n const store = createStore(rootReducer, enhancer)\n return store\n}\n"],"names":[],"sourceRoot":""}

2
dist/app.json vendored
View File

@@ -1 +1 @@
{"pages":["pages/index/index"],"window":{"backgroundTextStyle":"light","navigationBarBackgroundColor":"#fff","navigationBarTitleText":"WeChat","navigationBarTextStyle":"black"}} {"pages":["pages/home/index","pages/index/index"],"window":{"backgroundTextStyle":"light","navigationBarBackgroundColor":"#fff","navigationBarTitleText":"WeChat","navigationBarTextStyle":"black"},"lazyCodeLoading":"requiredComponents"}

117
dist/app.wxss vendored
View File

@@ -1,4 +1,119 @@
/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** 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/app.scss ***! !*** 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/app.scss ***!
\************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
::before,::after {
--tw-content: ""}
view,text,::before,::after {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-gradient-from-position: ;
--tw-gradient-via-position: ;
--tw-gradient-to-position: ;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0rpx;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(59 130 246 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style:
;
box-sizing: border-box;
border-width: 0;
border-style: solid;
border-color: currentColor}
::backdrop {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-gradient-from-position: ;
--tw-gradient-via-position: ;
--tw-gradient-to-position: ;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0rpx;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(59 130 246 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style:
}
.text-_red_ {
--tw-text-opacity: 1;
color: rgb(255 0 0 / var(--tw-text-opacity, 1))
}

135
dist/pages/home/index.js vendored Normal file
View File

@@ -0,0 +1,135 @@
"use strict";
(wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["pages/home/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/home/index!./src/pages/home/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/home/index!./src/pages/home/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 _tarojs_components__WEBPACK_IMPORTED_MODULE_3__ = __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 _api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../api */ "./src/api/index.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__);
class Home extends react__WEBPACK_IMPORTED_MODULE_0__.Component {
async sendMsg() {
await _api__WEBPACK_IMPORTED_MODULE_1__["default"].system.getBaidu();
}
render() {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
class: "text-_red_",
children: "123456"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
onClick: this.sendMsg,
children: "\u53D1\u9001"
})]
});
}
}
/* harmony default export */ __webpack_exports__["default"] = (Home);
/***/ }),
/***/ "./src/api/index.js":
/*!**************************!*\
!*** ./src/api/index.js ***!
\**************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var _system__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./system */ "./src/api/system/index.js");
const Api = {
system: {
..._system__WEBPACK_IMPORTED_MODULE_0__["default"]
}
};
/* harmony default export */ __webpack_exports__["default"] = (Api);
/***/ }),
/***/ "./src/api/system/index.js":
/*!*********************************!*\
!*** ./src/api/system/index.js ***!
\*********************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var _utils_request__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/request */ "./src/utils/request.js");
const system = {
getBaidu: async () => {
return (0,_utils_request__WEBPACK_IMPORTED_MODULE_0__["default"])({
url: 'https://www.baidu.com/s?wq=你好',
method: 'GET'
});
}
};
/* harmony default export */ __webpack_exports__["default"] = (system);
/***/ }),
/***/ "./src/pages/home/index.jsx":
/*!**********************************!*\
!*** ./src/pages/home/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_home_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/home/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/home/index!./src/pages/home/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_home_index_index_jsx__WEBPACK_IMPORTED_MODULE_1__["default"], 'pages/home/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_home_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_home_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_home_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_home_index_index_jsx__WEBPACK_IMPORTED_MODULE_1__["default"]);
/***/ }),
/***/ "./src/utils/request.js":
/*!******************************!*\
!*** ./src/utils/request.js ***!
\******************************/
/***/ (function(__unused_webpack_module, __webpack_exports__) {
const request = options => {
const {
method,
url
} = options;
return new Promise((resolve, reject) => {
wx.request({
url: url,
method: method || 'GET'
});
});
};
/* harmony default export */ __webpack_exports__["default"] = (request);
/***/ })
},
/******/ 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/home/index.jsx"); });
/******/ var __webpack_exports__ = __webpack_require__.O();
/******/ }
]);
//# sourceMappingURL=index.js.map

1
dist/pages/home/index.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":[""],"names":[],"mappings":"AAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;;;;AAIA;AACA;AACA;AACA;AACA;;;;AAIA;;;AAGA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}

1
dist/pages/home/index.json vendored Normal file
View File

@@ -0,0 +1 @@
{"navigationBarTitleText":"首页","usingComponents":{"comp":"../../comp"}}

2
dist/pages/home/index.wxml vendored Normal file
View File

@@ -0,0 +1,2 @@
<import src="../../base.wxml"/>
<template is="taro_tmpl" data="{{root:root}}" />

7
dist/pages/home/index.wxss vendored Normal file
View 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/home/index.scss ***!
\*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
.index {
flex-direction: column;
width: 100%;
}

View File

@@ -30,12 +30,12 @@ var moduleMap = {
"./@tarojs/runtime": function() { "./@tarojs/runtime": function() {
return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-GLEAZC6U_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-WRSQ3V3E_js"), __webpack_require__.e("node_modules_taro_weapp_prebundle_tarojs_runtime_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_runtime.js")); }; }); return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-GLEAZC6U_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-WRSQ3V3E_js"), __webpack_require__.e("node_modules_taro_weapp_prebundle_tarojs_runtime_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_runtime.js")); }; });
}, },
"./@tarojs/plugin-framework-react/dist/runtime": function() {
return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-GLEAZC6U_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-WRSQ3V3E_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-framework-react_dist_runtime_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_plugin-framework-react_dist_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_plugin-framework-react_dist_runtime.js")); }; });
},
"./@tarojs/plugin-platform-weapp/dist/runtime": function() { "./@tarojs/plugin-platform-weapp/dist/runtime": function() {
return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-GLEAZC6U_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-platform-weapp_dist_runtime_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js")); }; }); return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-GLEAZC6U_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-platform-weapp_dist_runtime_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js")); }; });
}, },
"./@tarojs/plugin-framework-react/dist/runtime": function() {
return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-GLEAZC6U_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-WRSQ3V3E_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_tarojs_plugin-framework-react_dist_runtime_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_plugin-framework-react_dist_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_plugin-framework-react_dist_runtime.js")); }; });
},
"./@tarojs/taro": function() { "./@tarojs/taro": function() {
return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-GLEAZC6U_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-WRSQ3V3E_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_tarojs_taro_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_taro.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_taro.js")); }; }); return Promise.all([__webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-GLEAZC6U_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_chunk-WRSQ3V3E_js"), __webpack_require__.e("vendors-node_modules_taro_weapp_prebundle_tarojs_taro_js")]).then(function() { return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_taro.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_taro.js")); }; });
}, },
@@ -92,12 +92,12 @@ var taroModuleMap = {
"./@tarojs/runtime": function() { "./@tarojs/runtime": function() {
return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_runtime.js")); }; return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_runtime.js")); };
}, },
"./@tarojs/plugin-framework-react/dist/runtime": function() {
return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_plugin-framework-react_dist_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_plugin-framework-react_dist_runtime.js")); };
},
"./@tarojs/plugin-platform-weapp/dist/runtime": function() { "./@tarojs/plugin-platform-weapp/dist/runtime": function() {
return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js")); }; return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_plugin-platform-weapp_dist_runtime.js")); };
}, },
"./@tarojs/plugin-framework-react/dist/runtime": function() {
return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_plugin-framework-react_dist_runtime.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_plugin-framework-react_dist_runtime.js")); };
},
"./@tarojs/taro": function() { "./@tarojs/taro": function() {
return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_taro.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_taro.js")); }; return function() { return (__webpack_require__(/*! ./node_modules/.taro/weapp/prebundle/@tarojs_taro.js */ "./node_modules/.taro/weapp/prebundle/@tarojs_taro.js")); };
}, },

View File

@@ -1,15 +1,33 @@
{ {
"miniprogramRoot": "./", "miniprogramRoot": "",
"projectname": "taro-template", "projectname": "taro-template",
"description": "taro模版", "description": "taro模版",
"appid": "touristappid", "appid": "wx99c8c167adcab8fc",
"setting": { "setting": {
"urlCheck": true, "urlCheck": false,
"es6": false, "es6": false,
"enhance": false, "enhance": false,
"compileHotReLoad": false, "compileHotReLoad": true,
"postcss": false, "postcss": true,
"minified": false "minified": true,
"uglifyFileName": true,
"bigPackageSizeSupport": true,
"swc": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
}, },
"compileType": "miniprogram" "compileType": "miniprogram",
"libVersion": "3.7.1",
"packOptions": {
"ignore": [],
"include": []
},
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
}
} }

14
dist/runtime.js vendored
View File

@@ -377,6 +377,20 @@
/******/ var chunkLoadingGlobal = wx["webpackJsonp"] = wx["webpackJsonp"] || []; /******/ var chunkLoadingGlobal = wx["webpackJsonp"] = wx["webpackJsonp"] || [];
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/ var miniHMRCallback = function(parentChunkLoadingFunction, data) {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/ if(chunkIds.some(function(id) { return installedChunks[id] === 0 })) {
/******/ chunkIds.forEach(id => {
/******/ delete installedChunks[id]
/******/ })
/******/ Object.keys(moreModules).forEach(id => {
/******/ delete __webpack_module_cache__[id]
/******/ })
/******/ }
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
/******/ }
/******/ chunkLoadingGlobal.push = miniHMRCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/ }(); /******/ }();
/******/ /******/
/************************************************************************/ /************************************************************************/

2
dist/runtime.js.map vendored

File diff suppressed because one or more lines are too long

View File

@@ -11,6 +11,7 @@
}, },
"scripts": { "scripts": {
"server": "pnpm run dev:weapp", "server": "pnpm run dev:weapp",
"postinstall": "weapp-tw patch",
"build:weapp": "taro build --type weapp", "build:weapp": "taro build --type weapp",
"build:swan": "taro build --type swan", "build:swan": "taro build --type swan",
"build:alipay": "taro build --type alipay", "build:alipay": "taro build --type alipay",
@@ -39,48 +40,49 @@
"@babel/runtime": "^7.21.5", "@babel/runtime": "^7.21.5",
"@tarojs/components": "4.0.8", "@tarojs/components": "4.0.8",
"@tarojs/helper": "4.0.8", "@tarojs/helper": "4.0.8",
"@tarojs/plugin-platform-weapp": "4.0.8", "@tarojs/plugin-framework-react": "4.0.8",
"@tarojs/plugin-platform-alipay": "4.0.8", "@tarojs/plugin-platform-alipay": "4.0.8",
"@tarojs/plugin-platform-tt": "4.0.8", "@tarojs/plugin-platform-h5": "4.0.8",
"@tarojs/plugin-platform-swan": "4.0.8",
"@tarojs/plugin-platform-jd": "4.0.8", "@tarojs/plugin-platform-jd": "4.0.8",
"@tarojs/plugin-platform-qq": "4.0.8", "@tarojs/plugin-platform-qq": "4.0.8",
"@tarojs/plugin-platform-h5": "4.0.8", "@tarojs/plugin-platform-swan": "4.0.8",
"@tarojs/plugin-platform-tt": "4.0.8",
"@tarojs/plugin-platform-weapp": "4.0.8",
"@tarojs/react": "4.0.8",
"@tarojs/runtime": "4.0.8", "@tarojs/runtime": "4.0.8",
"@tarojs/shared": "4.0.8", "@tarojs/shared": "4.0.8",
"@tarojs/taro": "4.0.8", "@tarojs/taro": "4.0.8",
"redux-logger": "^3.0.6", "react": "^18.0.0",
"redux-thunk": "^2.3.0",
"redux": "^4.0.0",
"react-redux": "^7.2.0",
"@tarojs/plugin-framework-react": "4.0.8",
"@tarojs/react": "4.0.8",
"react-dom": "^18.0.0", "react-dom": "^18.0.0",
"react": "^18.0.0" "react-redux": "^7.2.0",
"redux": "^4.0.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/preset-react": "^7.24.1",
"@babel/plugin-proposal-class-properties": "7.14.5",
"@babel/core": "^7.8.0", "@babel/core": "^7.8.0",
"@babel/plugin-proposal-class-properties": "7.14.5",
"@babel/preset-react": "^7.24.1",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.5",
"@tarojs/cli": "4.0.8", "@tarojs/cli": "4.0.8",
"@types/webpack-env": "^1.13.6",
"@types/react": "^18.0.0",
"webpack": "5.91.0",
"@tarojs/taro-loader": "4.0.8", "@tarojs/taro-loader": "4.0.8",
"@tarojs/webpack5-runner": "4.0.8", "@tarojs/webpack5-runner": "4.0.8",
"@types/node": "^18.15.11",
"@types/react": "^18.0.0",
"@types/webpack-env": "^1.13.6",
"autoprefixer": "^10.4.20",
"babel-preset-taro": "4.0.8", "babel-preset-taro": "4.0.8",
"eslint-config-taro": "4.0.8",
"eslint": "^8.12.0", "eslint": "^8.12.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.5", "eslint-config-taro": "4.0.8",
"react-refresh": "^0.11.0",
"eslint-plugin-react": "^7.8.2",
"eslint-plugin-import": "^2.12.0", "eslint-plugin-import": "^2.12.0",
"eslint-plugin-react": "^7.8.2",
"eslint-plugin-react-hooks": "^4.2.0", "eslint-plugin-react-hooks": "^4.2.0",
"postcss": "^8.4.49",
"react-refresh": "^0.11.0",
"stylelint": "^14.4.0", "stylelint": "^14.4.0",
"postcss": "^8.4.18", "tailwindcss": "^3.4.17",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"@types/node": "^18.15.11" "weapp-tailwindcss": "^3.7.0",
"webpack": "5.91.0"
} }
} }

945
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

7
postcss.config.js Normal file
View File

@@ -0,0 +1,7 @@
// postcss 插件以 object 方式注册的话,是按照由上到下的顺序执行的
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

View File

@@ -4,12 +4,15 @@
"description": "taro模版", "description": "taro模版",
"appid": "touristappid", "appid": "touristappid",
"setting": { "setting": {
"urlCheck": true, "urlCheck": false,
"es6": false, "es6": false,
"enhance": false, "enhance": false,
"compileHotReLoad": false, "compileHotReLoad": true,
"postcss": false, "postcss": true,
"minified": false "minified": true,
"uglifyFileName": true,
"bigPackageSizeSupport": true,
"swc": true
}, },
"compileType": "miniprogram" "compileType": "miniprogram"
} }

7
src/api/index.js Normal file
View File

@@ -0,0 +1,7 @@
import system from "./system";
const Api = {
system: {...system}
}
export default Api;

12
src/api/system/index.js Normal file
View File

@@ -0,0 +1,12 @@
import request from '../../utils/request';
const system = {
getBaidu: async () => {
return request({
url: 'https://www.baidu.com/s?wq=你好',
method: 'GET',
});
}
}
export default system;

View File

@@ -1,5 +1,6 @@
export default defineAppConfig({ export default defineAppConfig({
pages: [ pages: [
'pages/home/index',
'pages/index/index' 'pages/index/index'
], ],
window: { window: {
@@ -7,5 +8,6 @@ export default defineAppConfig({
navigationBarBackgroundColor: '#fff', navigationBarBackgroundColor: '#fff',
navigationBarTitleText: 'WeChat', navigationBarTitleText: 'WeChat',
navigationBarTextStyle: 'black' navigationBarTextStyle: 'black'
} },
lazyCodeLoading: "requiredComponents"
}) })

View File

@@ -0,0 +1,3 @@
@use 'tailwindcss/base' as *;
@use 'tailwindcss/components' as *;
@use 'tailwindcss/utilities' as *;

View File

@@ -0,0 +1,3 @@
export default definePageConfig({
navigationBarTitleText: '首页'
})

21
src/pages/home/index.jsx Normal file
View File

@@ -0,0 +1,21 @@
import { Component } from 'react'
import { View, Button } from '@tarojs/components'
import './index.scss'
import Api from "../../api";
class Home extends Component {
async sendMsg() {
await Api.system.getBaidu();
}
render() {
return (
<View>
<View class='text-[red]'>123456</View>
<Button onClick={this.sendMsg}>发送</Button>
</View>
)
}
}
export default Home

View File

@@ -0,0 +1,4 @@
.index {
flex-direction: column;
width: 100%;
}

11
src/utils/request.js Normal file
View File

@@ -0,0 +1,11 @@
const request = (options) => {
const { method, url } = options;
return new Promise((resolve, reject) => {
wx.request({
url: url,
method: method || 'GET',
});
});
}
export default request;

12
tailwind.config.js Normal file
View File

@@ -0,0 +1,12 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
// 这里给出了一份 taro 通用示例,具体要根据你自己项目的目录结构进行配置
// 比如你使用 vue3 项目,你就需要把 vue 这个格式也包括进来
// 不在 content glob 表达式中包括的文件,在里面编写 tailwindcss class是不会生成对应的 css 工具类的
content: ['./src/index.html', './src/**/*.{html,js,ts,jsx,tsx}'],
// 其他配置项 ...
corePlugins: {
// 小程序不需要 preflight因为这主要是给 h5 的,如果你要同时开发多端,你应该使用 process.env.TARO_ENV 环境变量来控制它
preflight: false,
},
}