Pythonic Vue.js
Project description
pyvuejs
Install
using pip
pip install pyvuejs
from git
git clone https://github.com/eseunghwan/pyvuejs.git
cd pyvuejs
python setup.py install
Usage
create project with cli
python -m pyvuejs init
[output]
//=========== pyvuejs project init ===========//
AppName:
move to project directory and start with cli
-
default host = "0.0.0.0", port = 8000
python -m pyvuejs start
[output]
//=========== start pyvuejs app ===========//
Running on http://0.0.0.0:8000 (CTRL + C to quit)
[2020-07-17 18:46:40,927] Running on 0.0.0.0:8000 over http (CTRL + C to quit)
start command line options
-
host only
python -m pyvuejs start 127.0.0.1
-
port only
python -m pyvuejs start 9000
-
both host and port
python -m pyvuejs start 127.0.0.1 9000
PVUE editing guide
-
pvue file is a single view file against with vue file
prefix(optional, default = "view")
-
prefix defines pvue is view or component
<!-- if pvue is view -->
!prefix view
<!-- if pvue is component -->
!prefix component
<!-- if blank, consider as view -->
template(required)
-
template block is shown part of pvue
-
code style is very same as Vue.js
<template>
<div id="app1">
<!-- elements -->
<p>{{ testVar }}</p>
<button>[buttonText]</button>
<!-- if show components -->
<component name="[componentName]">
</div>
</template>
model(required)
-
model block is server-side part of pvue
-
code style is python, it's sensitive to tabs
<model>
Model app1:
# variables
testVar = 10
# compute methods
@testVar.connect("method")
# to use session, add "session" argument to function
def sub_testVar(self, session):
self.testVar -= 1
</model>
-
connect to vue properties
- currently, computed and method are enable
- add decorator on top of function
@sample.connect("method") def get_sample(self): self.sample = "It's sample!"
style(optional)
-
style block is style part of template block
<style>
div#app1 {
/* styles */
}
</style>
script(optional)
-
script block runs in page
-
custom events, attributes can be set in script block
<script>
/* scripts */
</script>
Todo
- enable componenting(V 0.2.0)
- multi locational data binding(V 0.2.0)
- dataSession (V 0.2.0)
-
add vue properties
- method (V 0.1.0)
- computed (V 0.2.0)
- watch
License
pyvuejs is MIT license
Release History
-
V 0.1.0 [2020/07/17]
- initial commit
-
V 0.2.0 [2020/07/18]
- enable componenting
- multi locational data binding
- add computed binding
- dataSession
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyvuejs-0.2.0.tar.gz
(144.6 kB
view details)
Built Distribution
pyvuejs-0.2.0-py3-none-any.whl
(143.1 kB
view details)
File details
Details for the file pyvuejs-0.2.0.tar.gz
.
File metadata
- Download URL: pyvuejs-0.2.0.tar.gz
- Upload date:
- Size: 144.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6668fdcd41e1fe43d32e4adf1c093f4b5399adaf303a899dac9615730e5b93d3 |
|
MD5 | 9fd40ba5cc06cdada2c434d90536c86c |
|
BLAKE2b-256 | 80318a9bf02b2080c3a3a680ca68e9ef2740871af0a5dfa0afb651a86882677e |
File details
Details for the file pyvuejs-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: pyvuejs-0.2.0-py3-none-any.whl
- Upload date:
- Size: 143.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b925c6ac110ed17e38e04711e99f922bd5fea02bdaa6bc7c2a753d4e527b40f3 |
|
MD5 | edfaddc64183f1d85598b760b83305dc |
|
BLAKE2b-256 | 6c4c8aa8aa36e9cf47d0fd6acfe62ed26816d9a8388ada0fddd5ea700a687da1 |