Change page title

Change page title

by Niklesh

HTML

<script src="https://npmcdn.com/vue/dist/vue.js"></script></script>

<div id="app" class="container-fluid">
    <div class="row">
        <div class="col-xs-12">
            <div id="clines" class="table-responsive ctable">
                <base-table></base-table>
            </div>
        </div>
    </div>
</div>

JavaScript

Vue.component('base-table',{
	template:`<div>
  	<table class="table table-sm nowrapp">
                    <thead>
                        <tr>
                            <th>Command</th>
                            <th>Directory</th>
                            <th>Return</th>
                            <th>Pipes</th>
                            <th>When</th>
                            <th>Duration</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>time date</td>
                            <td>/root</td>
                            <td>42</td>
                            <td>2</td>
                            <td>Feb 2</td>
                            <td>44s</td>
                        </tr>
                    </tbody>
                    <srvaudit></srvaudit>
                </table>
                </div>
  `
});

Vue.component('srvaudit', {
    template: `
          <tbody>
                        <tr>
                            <td>time date</td>
                            <td>/root2</td>
                            <td>99</td>
                            <td>8</td>
                            <td>Feb 5</td>
                            <td>55s</td>
                        </tr>
                        <tr>
                            <td>time date</td>
                            <td>/root4</td>
                            <td>101</td>
                            <td>10</td>
                            <td>Feb 25</td>
                            <td>88s</td>
                        </tr>
                    </tbody>
    `,
    props: ['commands'],
    data() {
        return {
            commands: []
        };
    },
    mounted: function() {
        Echo.private(`session.${sid}.commands`)
            .listen('CommandReceived', (data) => {
                this.commands.push(data.command);  // Here is where it renders the component after pushing...