Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
visualcloud
/
Vmatrix-client-taro
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
31d03871
authored
Aug 12, 2019
by
lirandong
Browse files
Options
Browse Files
Download
Plain Diff
merge develop
parents
1f9681b8
6d03ea4b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
11 deletions
+33
-11
config/index.js
+27
-5
src/pages/home/tempaltes/index.tsx
+1
-1
tsconfig.json
+5
-5
No files found.
config/index.js
View file @
31d03871
const
path
=
require
(
'path'
)
// NOTE 在 sass 中通过别名(@ 或 ~)引用需要指定路径
const
lessImporter
=
function
(
url
)
{
if
(
url
[
0
]
===
'~'
&&
url
[
1
]
!==
'/'
)
{
return
{
file
:
path
.
resolve
(
__dirname
,
'..'
,
'node_modules'
,
url
.
substr
(
1
))
}
}
const
reg
=
/^@styles
\/(
.*
)
/
return
{
file
:
reg
.
test
(
url
)
?
path
.
resolve
(
__dirname
,
'..'
,
'src/styles'
,
url
.
match
(
reg
)[
1
])
:
url
}
}
const
config
=
{
const
config
=
{
projectName
:
'taroDemo'
,
projectName
:
'taroDemo'
,
date
:
'2019-8-12'
,
date
:
'2019-8-12'
,
...
@@ -11,11 +27,11 @@ const config = {
...
@@ -11,11 +27,11 @@ const config = {
outputRoot
:
'dist'
,
outputRoot
:
'dist'
,
alias
:
{
alias
:
{
'@/'
:
path
.
resolve
(
__dirname
,
'..'
,
'src'
),
'@/'
:
path
.
resolve
(
__dirname
,
'..'
,
'src'
),
'@
api/
'
:
path
.
resolve
(
__dirname
,
'..'
,
'src/api'
),
'@
/api
'
:
path
.
resolve
(
__dirname
,
'..'
,
'src/api'
),
'@
pages/
'
:
path
.
resolve
(
__dirname
,
'..'
,
'src/pages'
),
'@
/pages
'
:
path
.
resolve
(
__dirname
,
'..'
,
'src/pages'
),
'@
actions/
'
:
path
.
resolve
(
__dirname
,
'..'
,
'src/actions'
),
'@
/actions
'
:
path
.
resolve
(
__dirname
,
'..'
,
'src/actions'
),
'@
constants/
'
:
path
.
resolve
(
__dirname
,
'..'
,
'src/constants'
),
'@
/constants
'
:
path
.
resolve
(
__dirname
,
'..'
,
'src/constants'
),
'@
conpoments/
'
:
path
.
resolve
(
__dirname
,
'..'
,
'src/conpoments'
),
'@
/conpoments
'
:
path
.
resolve
(
__dirname
,
'..'
,
'src/conpoments'
),
},
},
plugins
:
{
plugins
:
{
babel
:
{
babel
:
{
...
@@ -30,6 +46,9 @@ const config = {
...
@@ -30,6 +46,9 @@ const config = {
'transform-class-properties'
,
'transform-class-properties'
,
'transform-object-rest-spread'
'transform-object-rest-spread'
]
]
},
less
:
{
importer
:
lessImporter
}
}
},
},
defineConstants
:
{
defineConstants
:
{
...
@@ -97,6 +116,9 @@ const config = {
...
@@ -97,6 +116,9 @@ const config = {
generateScopedName
:
'[name]__[local]___[hash:base64:5]'
generateScopedName
:
'[name]__[local]___[hash:base64:5]'
}
}
}
}
},
lessLoaderOption
:
{
importer
:
lessImporter
}
}
}
}
}
}
...
...
src/pages/home/tempaltes/index.tsx
View file @
31d03871
...
@@ -4,7 +4,7 @@ import Taro, { Component, Config } from '@tarojs/taro'
...
@@ -4,7 +4,7 @@ import Taro, { Component, Config } from '@tarojs/taro'
import
PageView
from
'@/constants/components/pageView'
import
PageView
from
'@/constants/components/pageView'
import
{
View
,
Text
,
Input
,
ScrollView
,
Image
}
from
'@tarojs/components'
import
{
View
,
Text
,
Input
,
ScrollView
,
Image
}
from
'@tarojs/components'
import
'./less/index.less'
import
'./less/index.less'
import
api
from
'@/api'
import
api
from
'@/api
/index
'
import
token
from
'@/constants/token'
import
token
from
'@/constants/token'
type
PageStateProps
=
{}
type
PageStateProps
=
{}
...
...
tsconfig.json
View file @
31d03871
...
@@ -22,11 +22,11 @@
...
@@ -22,11 +22,11 @@
"typeRoots"
:
[
"node_modules/@types"
],
"typeRoots"
:
[
"node_modules/@types"
],
"paths"
:
{
"paths"
:
{
"@/*"
:
[
"*"
],
"@/*"
:
[
"*"
],
"@
api/
*"
:
[
"api/*"
],
"@
/api
*"
:
[
"api/*"
],
"@
pages/
*"
:
[
"pages/*"
],
"@
/pages
*"
:
[
"pages/*"
],
"@
actions/
*"
:
[
"actions/*"
],
"@
/actions
*"
:
[
"actions/*"
],
"@
constants/
*"
:
[
"constants/*"
],
"@
/constants
*"
:
[
"constants/*"
],
"@
conpoments/
*"
:
[
"conpoments/*"
]
"@
/conpoments
*"
:
[
"conpoments/*"
]
}
}
},
},
"exclude"
:
[
"node_modules"
,
"dist"
],
"exclude"
:
[
"node_modules"
,
"dist"
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment