Vue.Js Trim String
home
Run
screen_rotation
fullscreen
cloud_download
<html> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.3.0/vue.js"></script> </head> <body> <div id="app"> <p>{{ text | trim }}</p> </div> <script> new Vue({ el: '#app', data: function() { return { text: ' This is string having space at both side. ' } }, filters: { trim: function(string) { return string.trim() } } }); </script> </body> </html>
<html> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.3.0/vue.js"></script> </head> <body> <div id="app"> <p>{{ text | trim }}</p> </div> <script> new Vue({ el: '#app', data: function() { return { text: ' This is string having space at both side. ' } }, filters: { trim: function(string) { return string.trim() } } }); </script> </body> </html>
Copyrights@tutorialsplane.com