# Article reading statistics
Same as Valine, Waline also supports article reading statistics, and the data structure is consistent with Valine, facilitating seamless migration for Valine users.
Waline({
el: '#waline',
// ...
visitor: true, // reading statistics
});
1
2
3
4
5
2
3
4
5
Valine will automatically find the elements which have leancloud_visitors
class in current page and use their id
as the query condition. And fill the obtained value into the child element whose class
value is leancloud-visitors-count
:
<!-- id will be used as the query condition -->
<span id="<Your/Path/Name>" class="leancloud_visitors">
<em class="post-meta-item-text">Visit Statistics </em>
<i class="leancloud-visitors-count"></i>
</span>
1
2
3
4
5
2
3
4
5
Demo
<span id="/visitor.html" class="leancloud_visitors">
<em class="post-meta-item-text"> Current page visits </em>
<i class="leancloud-visitors-count"></i>
</span>
1
2
3
4
2
3
4
TIPS: The comment area is only for demo. If you have any questions, please go to Github Discussion to ask.
Comments
Powered by Waline v1.0.0-beta.2
Preview: