-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from darwintree/main
doc: update demo readme
- Loading branch information
Showing
3 changed files
with
32 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,20 @@ | ||
# React + TypeScript + Vite | ||
# README | ||
|
||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. | ||
This is the example project showing how to use the `use-wallet` library to connect to Fluent wallet with Conflux eSpace as target chain using [React](https://react.dev/). | ||
|
||
Currently, two official plugins are available: | ||
You can also switch to other wallets like Metamask or switch to other target chains like Conflux core space by modifying the example code. | ||
|
||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh | ||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh | ||
## How to start | ||
|
||
## Expanding the ESLint configuration | ||
Making sure [node](https://nodejs.org/en) is installed. Then run | ||
|
||
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: | ||
|
||
- Configure the top-level `parserOptions` property like this: | ||
|
||
```js | ||
export default { | ||
// other rules... | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
project: ['./tsconfig.json', './tsconfig.node.json'], | ||
tsconfigRootDir: __dirname, | ||
}, | ||
} | ||
```sh | ||
# install dependencies | ||
npm install | ||
# develop and project will start on localhost:5173 | ||
npm run dev | ||
# or build | ||
npm run build | ||
# preview built files | ||
npm run preview | ||
``` | ||
|
||
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked` | ||
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked` | ||
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
# Vue 3 + TypeScript + Vite | ||
# README | ||
|
||
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more. | ||
This is the example project showing how to use the `use-wallet` library to connect to Fluent wallet with Conflux eSpace as target chain using [Vue.js](https://vuejs.org/). | ||
|
||
## Recommended Setup | ||
You can also switch to other wallets like Metamask or switch to other target chains like Conflux core space by modifying the example code. | ||
|
||
- [VS Code](https://code.visualstudio.com/) + [Vue - Official](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (previously Volar) and disable Vetur | ||
## How to start | ||
|
||
- Use [vue-tsc](https://github.com/vuejs/language-tools/tree/master/packages/tsc) for performing the same type checking from the command line, or for generating d.ts files for SFCs. | ||
Making sure [node](https://nodejs.org/en) is installed. Then run | ||
|
||
```sh | ||
# install dependencies | ||
npm install | ||
# develop and project will start on localhost:5173 | ||
npm run dev | ||
# or build | ||
npm run build | ||
# preview built files | ||
npm run preview | ||
``` |