* vue sample (#483) * initilaized vue * default mode implemented in app.vue * envexample added for projectID * removed empty space and tested dapp * deleted helloworld example component * pnpm * Update App.vue --------- Co-authored-by: Mohammed Abdul Sattar <93962265+mabsattar@users.noreply.github.com>
This commit is contained in:
parent
8a974713dd
commit
7826839498
1
dapps/web3modal/vue/.env.example
Normal file
1
dapps/web3modal/vue/.env.example
Normal file
@ -0,0 +1 @@
|
|||||||
|
VITE_PROJECT_ID=YOUR_PROJECT_ID
|
23
dapps/web3modal/vue/.gitignore
vendored
Normal file
23
dapps/web3modal/vue/.gitignore
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
/dist
|
||||||
|
|
||||||
|
|
||||||
|
# local env files
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
|
||||||
|
# Log files
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
24
dapps/web3modal/vue/README.md
Normal file
24
dapps/web3modal/vue/README.md
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# vue
|
||||||
|
|
||||||
|
## Project setup
|
||||||
|
```
|
||||||
|
yarn install
|
||||||
|
```
|
||||||
|
|
||||||
|
### Compiles and hot-reloads for development
|
||||||
|
```
|
||||||
|
yarn serve
|
||||||
|
```
|
||||||
|
|
||||||
|
### Compiles and minifies for production
|
||||||
|
```
|
||||||
|
yarn build
|
||||||
|
```
|
||||||
|
|
||||||
|
### Lints and fixes files
|
||||||
|
```
|
||||||
|
yarn lint
|
||||||
|
```
|
||||||
|
|
||||||
|
### Customize configuration
|
||||||
|
See [Configuration Reference](https://cli.vuejs.org/config/).
|
5
dapps/web3modal/vue/babel.config.js
Normal file
5
dapps/web3modal/vue/babel.config.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
module.exports = {
|
||||||
|
presets: [
|
||||||
|
'@vue/cli-plugin-babel/preset'
|
||||||
|
]
|
||||||
|
}
|
19
dapps/web3modal/vue/jsconfig.json
Normal file
19
dapps/web3modal/vue/jsconfig.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es5",
|
||||||
|
"module": "esnext",
|
||||||
|
"baseUrl": "./",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"paths": {
|
||||||
|
"@/*": [
|
||||||
|
"src/*"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"lib": [
|
||||||
|
"esnext",
|
||||||
|
"dom",
|
||||||
|
"dom.iterable",
|
||||||
|
"scripthost"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
47
dapps/web3modal/vue/package.json
Normal file
47
dapps/web3modal/vue/package.json
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"name": "vue",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"serve": "vue-cli-service serve",
|
||||||
|
"build": "vue-cli-service build",
|
||||||
|
"lint": "vue-cli-service lint"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@wagmi/connectors": "4.1.14",
|
||||||
|
"@wagmi/core": "2.6.5",
|
||||||
|
"@web3modal/wagmi": "4.0.5",
|
||||||
|
"core-js": "3.36.0",
|
||||||
|
"viem": "2.7.9",
|
||||||
|
"vue": "3.4.19"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/core": "7.12.16",
|
||||||
|
"@babel/eslint-parser": "7.12.16",
|
||||||
|
"@vue/cli-plugin-babel": "5.0.8",
|
||||||
|
"@vue/cli-plugin-eslint": "5.0.0",
|
||||||
|
"@vue/cli-service": "5.0.8",
|
||||||
|
"eslint": "7.32.0",
|
||||||
|
"eslint-plugin-vue": "8.0.3"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"root": true,
|
||||||
|
"env": {
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"plugin:vue/vue3-essential",
|
||||||
|
"eslint:recommended"
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"parser": "@babel/eslint-parser"
|
||||||
|
},
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
"> 1%",
|
||||||
|
"last 2 versions",
|
||||||
|
"not dead",
|
||||||
|
"not ie 11"
|
||||||
|
]
|
||||||
|
}
|
11731
dapps/web3modal/vue/pnpm-lock.yaml
generated
Normal file
11731
dapps/web3modal/vue/pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
BIN
dapps/web3modal/vue/public/favicon.ico
Normal file
BIN
dapps/web3modal/vue/public/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
17
dapps/web3modal/vue/public/index.html
Normal file
17
dapps/web3modal/vue/public/index.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||||
|
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript>
|
||||||
|
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||||
|
</noscript>
|
||||||
|
<div id="app"></div>
|
||||||
|
<!-- built files will be auto injected -->
|
||||||
|
</body>
|
||||||
|
</html>
|
42
dapps/web3modal/vue/src/App.vue
Normal file
42
dapps/web3modal/vue/src/App.vue
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<script setup>
|
||||||
|
import { createWeb3Modal, defaultWagmiConfig } from '@web3modal/wagmi/vue'
|
||||||
|
import { mainnet, arbitrum } from 'viem/chains'
|
||||||
|
import { reconnect } from '@wagmi/core'
|
||||||
|
|
||||||
|
// 1. Define constants
|
||||||
|
const projectId = 'YOUR_PROJECT_ID'
|
||||||
|
|
||||||
|
// 2. Create wagmiConfig
|
||||||
|
const metadata = {
|
||||||
|
name: 'Web3Modal',
|
||||||
|
description: 'Web3Modal Example',
|
||||||
|
url: 'https://web3modal.com', // origin must match your domain & subdomain
|
||||||
|
icons: ['https://avatars.githubusercontent.com/u/37784886']
|
||||||
|
}
|
||||||
|
|
||||||
|
const chains = [mainnet, arbitrum]
|
||||||
|
const config = defaultWagmiConfig({
|
||||||
|
chains, // required
|
||||||
|
projectId, // required
|
||||||
|
metadata, // required
|
||||||
|
enableWalletConnect: true, // Optional - true by default
|
||||||
|
enableInjected: true, // Optional - true by default
|
||||||
|
enableEIP6963: true, // Optional - true by default
|
||||||
|
enableCoinbase: true // Optional - true by default
|
||||||
|
})
|
||||||
|
|
||||||
|
reconnect(config)
|
||||||
|
// 3. Create modal
|
||||||
|
createWeb3Modal({
|
||||||
|
wagmiConfig: config,
|
||||||
|
projectId,
|
||||||
|
enableAnalytics: true // Optional - defaults to your Cloud configuration
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<w3m-button />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
|
BIN
dapps/web3modal/vue/src/assets/logo.png
Normal file
BIN
dapps/web3modal/vue/src/assets/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
4
dapps/web3modal/vue/src/main.js
Normal file
4
dapps/web3modal/vue/src/main.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import { createApp } from 'vue'
|
||||||
|
import App from './App.vue'
|
||||||
|
|
||||||
|
createApp(App).mount('#app')
|
4
dapps/web3modal/vue/vue.config.js
Normal file
4
dapps/web3modal/vue/vue.config.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
const { defineConfig } = require('@vue/cli-service')
|
||||||
|
module.exports = defineConfig({
|
||||||
|
transpileDependencies: true
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user