class DB
{
private static $db;
private $host = 'localhost';
private $dbname = 'test';
private $charset = 'utf8';
private $username = 'root';
private $password = '';
static public function connect()
{
if (self::$db === Null) {
self::$db = new self();
}
return self::$db;
}
private function __clone() {}
private function __construct()
{
return new \PDO("mysql:host=".$this->host.";dbname=".$this->dbname.";charset=".$this->charset, $this->username, $this->password);
}
}
$db = DB::connect();
npm install vue-select
import Vue from 'vue'
import vSelect from 'vue-select'
Vue.component('v-select', vSelect)
<v-select v-model="selected" :options="['foo','bar']"></v-select>
increment () {
if ((this.value + 1) > max) {
return;
}
this.value += 1
}