Quick start

Get APP_ID and APP_Key

Click here to register or login in leancloud.
Click here Create new application in Leancloud, and you will get APP ID/APP Key.

HTML structure

Please include the following HTML code in the appropriate location on the article page that requires the comment box:

<head>
    ...
    <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
    <script src='//unpkg.com/valine/dist/Valine.min.js'></script>
    ...
</head>
<body>
    ...
    <div id="vcomment"></div>
    <script>
        new Valine({
            el: '#vcomment' ,
            appId: '<APP_ID>',
            appKey: '<APP_Key>'
        });
    </script>
</body>

npm

Valine has been released to npm and can be installed directly by command:

# Install leancloud's js-sdk
npm install leancloud-storage --save
# Install valine
npm install valine --save

// Register AV objects to the global
window.AV = require('leancloud-storage');

// Use import
import Valine from 'valine';
// or Use require
const Valine = require('valine');

new Valine({
    el:'#vcomments',
    // other config
})

See the Config for more details.

© 2017 - 2018
Powered By xCss.