Skip to main content

Pythonic Vue.js

Project description




RE:Newal!

  • changed project style more silimar to vuejs 2.x template
  • use vue file by vbuild

Install

using pip

pip install pyvuejs



Usage

start server by main.py file in project directory

python ./main.py



view/component editing guide

same as vue.js, can support by linting

<!-- template block -->
<template>
    <div>
        <label>{{ count }}</label>
        <div>
            <button style="margin-right:10px;" v-on:click="up_count">up</button>
            <button v-on:click="down_count">down</button>
        </div>
    </div>
</template>
<!-- style block -->
<style scoped>
button {
    width: 80px;
}
</style>
<!-- script block -->
<script lang="python">
class Component:
    def __init__(self):
        self.count = 0

    def up_count(self):
        self.count += 1

    def down_count(self):
        if self.count > 0:
            self.count -= 1
</script>



use view/component

just call name in other view

<template>
    <div id="app">
        <div id="nav">
            <label v-on:click="show_home">Home</label> |
            <label v-on:click="show_about">About</label> | 
            <label v-on:click="show_counter">Counter</label>
        </div>
        <Home v-if="page == 'Home'" />
        <About v-else-if="page == 'About'" />
        <Counter v-else-if="page == 'Counter'" />
        <div v-else></div>
    </div>
</template>



function mapping

call map on main.py

  • parameters
    • callback[required]: callback to map
    • method[optional(default="GET")]: method of map
    • group[optional(default="fn")]: url group of map
def some_callback():
    """
    callback job
    """

Vue().map(
    some_callback, method = "GET", group = "fn"
).serve()

Todo

  • routes


License

pyvuejs is MIT license



Release History

2.0.0

  • renewal version1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyvuejs-2.0.3.tar.gz (76.3 kB view details)

Uploaded Source

Built Distribution

pyvuejs-2.0.3-py3-none-any.whl (77.6 kB view details)

Uploaded Python 3

File details

Details for the file pyvuejs-2.0.3.tar.gz.

File metadata

  • Download URL: pyvuejs-2.0.3.tar.gz
  • Upload date:
  • Size: 76.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

File hashes

Hashes for pyvuejs-2.0.3.tar.gz
Algorithm Hash digest
SHA256 948e677db8c3ad6ddc86c86f43feddb81a700bef9a3d0fbe9b176c4ea5df250b
MD5 e2eca90b0a0e0db77588ce04fa367ca2
BLAKE2b-256 617243d5444cb378c71554c60e8f45989ea418d8b92153613cd404dc7004e68b

See more details on using hashes here.

File details

Details for the file pyvuejs-2.0.3-py3-none-any.whl.

File metadata

  • Download URL: pyvuejs-2.0.3-py3-none-any.whl
  • Upload date:
  • Size: 77.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

File hashes

Hashes for pyvuejs-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fd1d878f93307900ca5e2cd0ba3348cfb13e557f2822793c5dde00215401b461
MD5 c3d480c0fa5dafc661157778db536735
BLAKE2b-256 bcbe7ac0738da1309492f0deebd894a5c1ff1b8951f0e68011beb4a39d95166b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page